Fern Definition isn’t recommended for new customers and Fern isn’t accepting feature requests for this format. It remains supported for existing users.
You can add examples for types and endpoints. Examples are shown as comments in your SDKs, in the request & response of your documentation, and in a Postman Collection.
The Fern CLI validates that your examples match the expected types. The following won’t compile:
You can reference an example from another type, endpoint, or error.
Just like types, you can compose examples. To reference an example from another
type, use $.
You can add examples of successful and error responses for your endpoints. Examples can reference the examples of types to avoid duplication.
When you have global headers defined in your api.yml, you must include them in your examples: