Fern Definition isn’t recommended for new customers and Fern isn’t accepting feature requests for this format. It remains supported for existing users.
In order to generate SDKs idiomatically, Fern needs to know how to differentiate between different errors when parsing an endpoint response.
You can specify Fern to discriminate by status code. This means on each endpoint, every error that’s listed must have a different HTTP status code.
You can specify Fern to discriminate by error name. If you select this strategy, then Fern will assume that every error response has an extra property denoting the error name.
If you use Fern to generate server-side code, then this option provides the most flexibility. Otherwise, you’ll probably want to use the status code discrimination strategy.
You can import and list errors that will be thrown by every endpoint.