Request + response examples
Fern generates realistic examples automatically using AI-generated examples, enabled by default. Use x-fern-examples to manually define specific example values. Manual examples take priority over AI-generated ones. You can also disable AI examples entirely.
Use x-fern-examples when you need to associate specific request and response pairs or define multiple named examples for an endpoint. While OpenAPI has several example fields, it provides no way to link a request with its corresponding response.
x-fern-examples is an array where each element can contain path-parameters, query-parameters, request, and response values that are all associated. Optionally, add a name field to provide a descriptive label for each example.
If you defined global headers via the x-fern-global-headers extension, you must include the headers in your examples.
Code samples
Fern generators automatically add SDK code samples. If you’d like to specify custom code samples for your example, use code-samples.