Build APIs Quicker

Designing and developing APIs involve a good amount of repeating and re-writing descriptions, which can be both time consuming and frustrating. Enter Domains.

Domains are a collection of reusable components. The components that can be stored inside a Domain are:

  • Definitions These are models which describe your APIs inputs and outputs
  • Path Items A set of predefined operations that can be reused across paths
  • Parameters Any input into an API
  • Responses The output from making an API call

Users can create and version Domains, and then define the reusable components that can be stored inside them. The components can be referenced from other APIs or Domains, either by the user or the collaborators on the API. The Domain UI helps all the API stakeholders better visualize the components of the Domain, while allowing for quick readability and detection of errors.

Creating a Domain

After a suitable name and version of the Domain is set, the user can add the required components inside the domain. Once the components are put in, the Domain can be published.

Here’s a Sample Domain to help you get started.

Referencing your own Domain is easy! Just start the reference and let SwaggerHub help you choose the right Domain and component with its new auto-suggest feature. Start typing the name of your Domain’s object you wish to reference to bring up the auto-suggests.

You can also reference Public or shared Private Domains directly using the syntax below:

$ref: '{ownerId}/{domainName}/{domainVersion}#/{componentType}/{componentName}'

Managing a Domain

Domains are managed the same way as APIs. Created Domains can be edited, bumped to a different version, pushed to GitHub or deleted. Domains can be either Public or Private. Public Domains can be searched for, viewed, referenced and forked by other SwaggerHub users, while Private Domains can only be viewed and worked on by you and the collaborators you’ve added.

Domains can also act as a control center for multiple APIs, one change in a Domain can quickly transmit across all the APIs which reference the Domain, thus allowing for faster API development and collaboration.

Back To All Features
Questions? Email us at or call: U.S. +1 617-684-2600, EMEA +353 91-398300, APAC +61 391929960