Creating a Domain

Last modified on May 06, 2021

You can create a new domain from scratch, and then add content to it, or you can fork an existing domain like you fork an API.

To create a new domain:

  1. In the top left corner of any page, click and select Create New Domain.

    Adding a new domain
  2. Enter domain information:

    Domain information
    • OpenAPI Version – Choose the domain format: OpenAPI 2.0 or 3.0. Note: OpenAPI 3.0 support has some limitations.

    • Name – The domain name is its unique ID and is part of its URL on SwaggerHub, as in https://app.swaggerhub.com/domains/{owner}/commons/1.0.

      Requirements:

      • 3 to 60 character long
      • allowed characters: A..Z a..z 0..9 - _ .
      • must start and end with a letter or digit
      Note: Domain names are case-sensitive, so commons and Commons are two different domains.
    • Version – The version number of the domain. For example, 1.0, 1.0.0, 1.0rc5, beta, 2016-04-15, and so on. See Version Format.

    • Owner – Choose whether to create the domain in your personal or organization account (if you are a member of an organization on SwaggerHub). The domain owner is part of the domain path in SwaggerHub: https://app.swaggerhub.com/domains/companyname/{domain-name}/1.0. Organization-owned domains count toward the organization’s limits rather than yours.

      Note: Organization owners can always create domains in that organization. Members with the Designer role have “create” permissions if the organization is configured with the Allow Designers to Create APIs under the Organization option.
    • Project – If an organization is selected as the Owner, you can optionally select a project to add this domain to. The list contains existing projects available to you.

      SwaggerHub On-Premise note: This option was added in v. 1.23.
    • Visibility – Choose whether the domain will be public (visible to anyone in your company) or private (can be accessed only by you and by the collaborators with whom you share the domain). For details, see Public and Private APIs.

  3. Click Create Domain.

After you create a domain, the SwaggerHub editor opens, in which you can add components to your domain, such as common parameters and data models. Once the components are added, you can refer to them from your APIs.

See Also

Domains
Referring to a Domain
Creating a New API

Highlight search results