Endpoint Schema Snippet

The EndpointSchemaSnippet component is used to reference an endpoint’s schema from your API Reference. Below are examples of referencing the schema for the POST /snippets endpoint.

If you want to reference a particular piece of the schema, you can use the optional selector prop to specify the path to the schema you want to reference. The available selectors are: request, request.path, request.query, request.body, response, and response.body.

Full Request


Passing request as the selector will only render the request schema.

The following markdown:

1<EndpointSchemaSnippet endpoint="POST /snippets" selector="request" />

will be rendered as:


Request

endpointobjectRequired
orgIdstringOptional
If the same API is defined across multiple organization, you must specify an organization ID.
apiIdstringOptional
If you have more than one API, you must specify its ID.
sdkslist of objectsOptional
The SDKs for which to load snippets. If unspecified, snippets for the latest published SDKs will be returned.
exampleIdentifierstringOptional
The identifier of the example to fetch the snippet for, this is ignored if a payload is passed in.
payloadobjectOptional
The JSON payload to be used as the input for the code snippet. This should just be thought of as the request body you'd be sending to the endpoint as a cURL. If not specified then the default payload will be used.

The EndpointSchemaSnippet component does not yet support rendering markdown-rich field descriptions.

See request.endpoint.path above for an example of a markdown-rich description that does not yet render as markdown.