Skip to content

Commit b3ae9c1

Browse files
authored
(api definitions) Document group-environments-by-host option, small clarifying edits to api options (#1241)
1 parent bf1f52f commit b3ae9c1

File tree

2 files changed

+31
-23
lines changed

2 files changed

+31
-23
lines changed

fern/products/sdks/reference/generators-yml-reference.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ api:
202202
</ParamField>
203203

204204
<ParamField path="namespace" type="string" toc={true}>
205-
Namespace for the specification.
205+
Namespace for the specification. Useful for configuring a [single package with multiple API versions](/api-definitions/overview/project-structure#option-2-namespace-based-versioning).
206206
</ParamField>
207207

208208
<ParamField path="settings" type="object" toc={true}>
@@ -220,6 +220,10 @@ api:
220220
<ParamField path="settings.respect-nullable-schemas" type="boolean" default="false" toc={true}>
221221
Preserves nullable schemas in API definition settings. When false, nullable schemas are treated as optional.
222222
</ParamField>
223+
<ParamField path="settings.group-environments-by-host" type="boolean" default="false" toc={true}>
224+
When enabled, groups servers by host into unified environments, enabling APIs with multiple protocols (REST, WebSocket, etc.) to share environment configuration. Environment URL IDs use the server name, with path or protocol suffixes added only when needed to resolve collisions.
225+
226+
</ParamField>
223227
</Accordion>
224228
<Accordion title="gRPC/proto buffers">
225229

@@ -264,7 +268,7 @@ api:
264268
</Accordion>
265269
<Accordion title="Conjure">
266270

267-
```yaml
271+
```yaml title="generators.yml"
268272
api:
269273
specs:
270274
conjure: "./conjure-api.yml"

fern/snippets/openapi-specs.mdx

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,95 +30,95 @@ api:
3030
</ParamField>
3131
3232
<ParamField path="namespace" type="string" toc={true}>
33-
Namespace for the specification.
33+
Namespace for the specification. Useful for configuring a [single package with multiple API versions](/api-definitions/overview/project-structure#option-2-namespace-based-versioning).
3434
</ParamField>
3535
36-
<ParamField path="settings" type="OpenAPISettingsSchema" toc={true}>
36+
<ParamField path="settings" type="object" toc={true}>
3737
OpenAPI-specific generation settings.
3838
</ParamField>
3939
4040
<ParamField path="settings.title-as-schema-name" type="boolean" default="true" toc={true}>
4141
Whether to use the titles of schemas within an OpenAPI definition as the names of types within Fern.
4242
</ParamField>
4343
44-
<ParamField path="inline-path-parameters" type="boolean" default="false" toc={true}>
44+
<ParamField path="settings.inline-path-parameters" type="boolean" default="false" toc={true}>
4545
Whether to include path parameters within the generated in-lined request.
4646
</ParamField>
4747
48-
<ParamField path="inline-all-of-schemas" type="boolean" default="false" toc={true}>
48+
<ParamField path="settings.inline-all-of-schemas" type="boolean" default="false" toc={true}>
4949
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.
5050

5151
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.
5252
</ParamField>
5353

54-
<ParamField path="prefer-undiscriminated-unions-with-literals" type="boolean" default="false" toc={true}>
54+
<ParamField path="settings.prefer-undiscriminated-unions-with-literals" type="boolean" default="false" toc={true}>
5555
Whether to prefer undiscriminated unions with literals.
5656
</ParamField>
5757

58-
<ParamField path="only-include-referenced-schemas" type="boolean" default="false" toc={true}>
58+
<ParamField path="settings.only-include-referenced-schemas" type="boolean" default="false" toc={true}>
5959
Whether to only include schemas referenced by endpoints in the generated SDK (tree-shaking).
6060
</ParamField>
6161

62-
<ParamField path="respect-nullable-schemas" type="boolean" default="false" toc={true}>
62+
<ParamField path="settings.respect-nullable-schemas" type="boolean" default="false" toc={true}>
6363
Preserves nullable schemas in API definition settings. When false, nullable schemas are treated as optional.
6464
</ParamField>
6565

66-
<ParamField path="object-query-parameters" type="boolean" toc={true}>
66+
<ParamField path="settings.object-query-parameters" type="boolean" toc={true}>
6767
Enables parsing deep object query parameters.
6868
</ParamField>
6969

70-
<ParamField path="respect-readonly-schemas" type="boolean" toc={true}>
70+
<ParamField path="settings.respect-readonly-schemas" type="boolean" toc={true}>
7171
Enables exploring readonly schemas in OpenAPI specifications.
7272
</ParamField>
7373

74-
<ParamField path="respect-forward-compatible-enums" type="boolean" default="false" toc={true}>
74+
<ParamField path="settings.respect-forward-compatible-enums" type="boolean" default="false" toc={true}>
7575
Enables respecting forward compatible enums in OpenAPI specifications.
7676
</ParamField>
7777

78-
<ParamField path="use-bytes-for-binary-response" type="boolean" toc={true}>
78+
<ParamField path="settings.use-bytes-for-binary-response" type="boolean" toc={true}>
7979
Enables using the `bytes` type for binary responses. Defaults to file stream.
8080
</ParamField>
8181

82-
<ParamField path="default-form-parameter-encoding" type="FormParameterEncoding" default="json" toc={true}>
82+
<ParamField path="settings.default-form-parameter-encoding" type="string" default="json" toc={true}>
8383
The default encoding of form parameters. Options: `form`, `json`.
8484
</ParamField>
8585

86-
<ParamField path="additional-properties-defaults-to" type="boolean" default="false" toc={true}>
86+
<ParamField path="settings.additional-properties-defaults-to" type="boolean" default="false" toc={true}>
8787
Configure what `additionalProperties` should default to when not explicitly defined on a schema.
8888
</ParamField>
8989

90-
<ParamField path="type-dates-as-strings" type="boolean" default="true" toc={true}>
90+
<ParamField path="settings.type-dates-as-strings" type="boolean" default="true" toc={true}>
9191
If true, convert strings with format date to strings. If false, convert to dates.
9292
</ParamField>
9393

94-
<ParamField path="preserve-single-schema-oneof" type="boolean" default="false" toc={true}>
94+
<ParamField path="settings.preserve-single-schema-oneof" type="boolean" default="false" toc={true}>
9595
If true, preserve oneOf structures with a single schema. If false, unwrap them.
9696
</ParamField>
9797

98-
<ParamField path="filter.endpoints" type="list<string>" toc={true}>
98+
<ParamField path="settings.filter.endpoints" type="list of strings" toc={true}>
9999
Endpoints to include in the generated SDK (e.g., "POST /users").
100100
</ParamField>
101101

102-
<ParamField path="example-generation.request.max-depth" type="integer" toc={true}>
102+
<ParamField path="settings.example-generation.request.max-depth" type="integer" toc={true}>
103103
Controls the maximum depth for which optional properties will have examples generated. A depth of 0 means no optional properties will have examples.
104104
</ParamField>
105105

106-
<ParamField path="example-generation.response.max-depth" type="integer" toc={true}>
106+
<ParamField path="settings.example-generation.response.max-depth" type="integer" toc={true}>
107107
Controls the maximum depth for which optional properties will have examples generated in responses.
108108
</ParamField>
109109

110-
<ParamField path="coerce-enums-to-literals" type="boolean" default="true" toc={true}>
110+
<ParamField path="settings.coerce-enums-to-literals" type="boolean" default="true" toc={true}>
111111
Controls whether enums are converted to literal types during code generation. When set to `false`, enums are preserved as enums rather than being converted to literal types. This is useful when you want to maintain the original enum structure from your OpenAPI specification.
112112
</ParamField>
113113

114-
<ParamField path="idiomatic-request-names" type="boolean" default="false" toc={true}>
114+
<ParamField path="settings.idiomatic-request-names" type="boolean" default="false" toc={true}>
115115
Controls the naming convention for autogenerated request names. When enabled, places the verb before the noun in request names (e.g., `UsersListRequest` becomes `ListUsersRequest`), following more idiomatic naming patterns.
116116

117117
Disabled by default to maintain backwards compatibility.
118118

119119
</ParamField>
120120

121-
<ParamField path="resolve-aliases" type="boolean" default="false" toc={true}>
121+
<ParamField path="settings.resolve-aliases" type="boolean" default="false" toc={true}>
122122
Inlines type aliases to simplify your generated SDK. When enabled, reduces
123123
unnecessary type definitions by replacing simple aliases with their underlying
124124
types directly. Useful for OpenAPI specs with many primitive or simple type
@@ -139,3 +139,7 @@ api:
139139
- OrganizationId
140140
```
141141
</ParamField>
142+
<ParamField path="settings.group-environments-by-host" type="boolean" default="false" toc={true}>
143+
When enabled, groups servers by host into unified environments, enabling APIs with multiple protocols (REST, WebSocket, etc.) to share environment configuration. Environment URL IDs use the server name, with path or protocol suffixes added only when needed to resolve collisions.
144+
145+
</ParamField>

0 commit comments

Comments
 (0)