|
| 1 | +```yaml title="generators.yml" |
| 2 | +api: |
| 3 | + specs: |
| 4 | + - openapi: "./openapi.yml" |
| 5 | + origin: "https://api.example.com/openapi.json" |
| 6 | + overrides: "./openapi-overrides.yml" |
| 7 | + namespace: "v1" |
| 8 | + settings: |
| 9 | + title-as-schema-name: true |
| 10 | + inline-path-parameters: false |
| 11 | + inline-all-of-schemas: true |
| 12 | + prefer-undiscriminated-unions-with-literals: true |
| 13 | + filter: |
| 14 | + endpoints: ["POST /users", "GET /users/{id}"] |
| 15 | + example-generation: |
| 16 | + request: |
| 17 | + max-depth: 2 |
| 18 | +``` |
| 19 | +
|
| 20 | +<ParamField path="openapi" type="string" required={true} toc={true}> |
| 21 | + Path to the OpenAPI specification file. |
| 22 | +</ParamField> |
| 23 | +
|
| 24 | +<ParamField path="origin" type="string" toc={true}> |
| 25 | + URL of the API definition origin for polling updates. |
| 26 | +</ParamField> |
| 27 | +
|
| 28 | +<ParamField path="overrides" type="string" toc={true}> |
| 29 | + Path to OpenAPI overrides file. |
| 30 | +</ParamField> |
| 31 | +
|
| 32 | +<ParamField path="namespace" type="string" toc={true}> |
| 33 | + Namespace for the specification. |
| 34 | +</ParamField> |
| 35 | +
|
| 36 | +<ParamField path="settings" type="OpenAPISettingsSchema" toc={true}> |
| 37 | + OpenAPI-specific generation settings. |
| 38 | +</ParamField> |
| 39 | +
|
| 40 | +<ParamField path="title-as-schema-name" type="boolean" default="true" toc={true}> |
| 41 | + Whether to use the titles of schemas within an OpenAPI definition as the names of types within Fern. |
| 42 | +</ParamField> |
| 43 | +
|
| 44 | +<ParamField path="inline-path-parameters" type="boolean" default="false" toc={true}> |
| 45 | + Whether to include path parameters within the generated in-lined request. |
| 46 | +</ParamField> |
| 47 | +
|
| 48 | +<ParamField path="inline-all-of-schemas" type="boolean" default="false" toc={true}> |
| 49 | + Whether to inline `allOf` schemas during code generation. When true, Fern recursively visits `allOf` schema definitions and inlines them into the child schema. When false, `allOf` schemas are extended through inheritance. |
| 50 | + |
| 51 | + Enabling this setting allows child schemas to override parent property requirements. For example, a child schema can mark a parent's required property as optional. Without this setting, Fern ignores the child schema's optional declaration and preserves the parent schema's requirement instead. |
| 52 | +</ParamField> |
| 53 | + |
| 54 | +<ParamField path="prefer-undiscriminated-unions-with-literals" type="boolean" default="false" toc={true}> |
| 55 | + Whether to prefer undiscriminated unions with literals. |
| 56 | +</ParamField> |
| 57 | + |
| 58 | +<ParamField path="only-include-referenced-schemas" type="boolean" default="false" toc={true}> |
| 59 | + Whether to only include schemas referenced by endpoints in the generated SDK (tree-shaking). |
| 60 | +</ParamField> |
| 61 | + |
| 62 | +<ParamField path="respect-nullable-schemas" type="boolean" default="false" toc={true}> |
| 63 | + Preserves nullable schemas in API definition settings. When false, nullable schemas are treated as optional. |
| 64 | +</ParamField> |
| 65 | + |
| 66 | +<ParamField path="object-query-parameters" type="boolean" toc={true}> |
| 67 | + Enables parsing deep object query parameters. |
| 68 | +</ParamField> |
| 69 | + |
| 70 | +<ParamField path="respect-readonly-schemas" type="boolean" toc={true}> |
| 71 | + Enables exploring readonly schemas in OpenAPI specifications. |
| 72 | +</ParamField> |
| 73 | + |
| 74 | +<ParamField path="respect-forward-compatible-enums" type="boolean" default="false" toc={true}> |
| 75 | + Enables respecting forward compatible enums in OpenAPI specifications. |
| 76 | +</ParamField> |
| 77 | + |
| 78 | +<ParamField path="use-bytes-for-binary-response" type="boolean" toc={true}> |
| 79 | + Enables using the `bytes` type for binary responses. Defaults to file stream. |
| 80 | +</ParamField> |
| 81 | + |
| 82 | +<ParamField path="default-form-parameter-encoding" type="FormParameterEncoding" default="json" toc={true}> |
| 83 | + The default encoding of form parameters. Options: `form`, `json`. |
| 84 | +</ParamField> |
| 85 | + |
| 86 | +<ParamField path="additional-properties-defaults-to" type="boolean" default="false" toc={true}> |
| 87 | + Configure what `additionalProperties` should default to when not explicitly defined on a schema. |
| 88 | +</ParamField> |
| 89 | + |
| 90 | +<ParamField path="type-dates-as-strings" type="boolean" default="true" toc={true}> |
| 91 | + If true, convert strings with format date to strings. If false, convert to dates. |
| 92 | +</ParamField> |
| 93 | + |
| 94 | +<ParamField path="preserve-single-schema-oneof" type="boolean" default="false" toc={true}> |
| 95 | + If true, preserve oneOf structures with a single schema. If false, unwrap them. |
| 96 | +</ParamField> |
| 97 | + |
| 98 | +<ParamField path="filter.endpoints" type="list<string>" toc={true}> |
| 99 | + Endpoints to include in the generated SDK (e.g., "POST /users"). |
| 100 | +</ParamField> |
| 101 | + |
| 102 | +<ParamField path="example-generation.request.max-depth" type="integer" toc={true}> |
| 103 | + Controls the maximum depth for which optional properties will have examples generated. A depth of 0 means no optional properties will have examples. |
| 104 | +</ParamField> |
| 105 | + |
| 106 | +<ParamField path="example-generation.response.max-depth" type="integer" toc={true}> |
| 107 | + Controls the maximum depth for which optional properties will have examples generated in responses. |
| 108 | +</ParamField> |
0 commit comments