Customization
Adding SDK examples
Display language-specific code samples alongside your API endpoints to show developers how to use your SDKs
If your users interact with your API using an SDK rather than directly through a network request, you can use the x-codeSamples
extension to add code samples to your OpenAPI document and display them in your OpenAPI pages.
This property can be added to any request method and has the following schema.
The language of the code sample.
The label for the sample. This is useful when providing multiple examples for a single endpoint.
The source code of the sample.
Here is an example of code samples for a plant tracking app, which has both a Bash CLI tool and a JavaScript SDK.