Hear from Salesforce leaders on how to create and deploy Agentforce agents.
Contact Us 1-800-596-4880

Differences for OAS 3.0 in Rendered Documentation

The right pane of the text editor in API Designer displays the documentation that is written into API specifications. Documentation is rendered identically for REST API specifications written in RAML or OAS 2.0. However, documentation for API specifications written in OAS 3.0 can include multiple server definitions as well as links and callbacks.

Documentation for Definitions of Multiple Servers

OAS 3.0 enables you to define servers by using the servers field. You can define servers globally at the top of a specification, locally for endpoints, and locally for methods. Local definitions override the definitions set at the next higher level in the specification’s hierarchy. Definitions set locally for methods override definitions set at endpoints and globally. Definitions set locally for endpoints override definitions set globally.

The following example API specification demonstrates different ways, indicated by ten callouts (1-10), that you can set server definitions. After the example API specification, the documentation for the portion of the API at each callout is illustrated with a screenshot.

  1. The Summary page of the documentation for this API lists the four servers that are defined in this servers field:

    A list of API servers and endpoints with their available methods.
  2. The /default endpoint does not override the base servers definition at the top of the API. On the Overview page for the endpoint, you can select a server to see the URI for this endpoint at that server:

    A dialog box with a server selection dropdown and a GET button.
  3. The GET method for the /default endpoint also inherits the four servers in the base servers definition. On the page for this method, you can select a server to see the URI for this method at that server:

    An API documentation page with code examples and responses.
  4. The /duplicated endpoint overrides the base servers definition, its local servers definition including only the last two servers of the original four. On the Overview page for the endpoint, you can select a server to see the URI for this endpoint at that server:

    A dropdown menu for choosing your server.
  5. The GET method for the /duplicated endpoint inherits the two servers in the local servers definition. On the page for this method, you can select a server to see the URI for this method at that server:

    An API documentation page demonstrating the GET method for duplicate data.
  6. The /files endpoint overrides the base servers definition, its local servers definition including only one server. On the Overview page for this endpoint, there are no servers to choose from, as there were for the previous two endpoints:

    An API documentation page with instructions for file upload and download actions.
  7. The GET method for the /files endpoint inherits the one server in the local servers definition. On the page for this method, there is no list of servers to choose from:

    "An API documentation page illustrating the GET method for file retrieval
  8. The /ping endpoint overrides the base servers definition, its local servers definition including only one server. On the Overview page for this endpoint, there are no servers to choose from:

    An arrow points to a URL.
  9. The GET method for the /ping endpoint overrides both the base servers definition and the /ping endpoint’s local servers definition. The GET method’s local servers definition includes two servers. On the page for this method, you can select a server to see the URI for this method at that server:

    "A form with a server selection dropdown
  10. The POST method for the /ping endpoint inherits the one server in the /ping endpoint’s local servers definition. On the Overview page for this endpoint, there is no list of servers to choose from:

    a code snippet that demonstrates the post method for /ping.

OAS 3.0 enables you to define links and callbacks. For an explanation of these features, see the specification for openAPI 3.0 at https://swagger.io/.

The following example API specification demonstrates how to set links and callbacks. The callouts indicate parts of the API specification that are rendered as documentation in the screenshots that follow.

  1. The links for the 200 response for the POST method of the /subscribe endpoint appear at the bottom of the method’s documentation:

    "Two tables with variable and expression columns.
  2. The links for the 402 response for the POST method of the /subscribe endpoint appear at the bottom of the method’s documentation:

    A table that displays variables and their expressions.

The documentation for callouts 3-5 appear in the Callbacks section of the documentation for the POST method of the /subscribe endpoint:

A list of API calls, including parameters, body, and responses.