Enum descriptions and names
OpenAPI doesn’t natively support adding descriptions to enum values. To do this in Fern you can use the x-fern-enum
extension.
In the example below, we’ve added some descriptions to enum values. These descriptions will propagate into the generated SDK and docs website.
openapi.yml
x-fern-enum
also supports a name
field that allows you to customize the name of the enum in code.
This is particularly useful when you have enums that rely on symbolic characters that would otherwise cause
generated code not to compile.
For example, the following OpenAPI
openapi.yml
would generate
operand.ts