Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions fern/snippets/openapi-specs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ api:
inline-path-parameters: false
inline-all-of-schemas: true
prefer-undiscriminated-unions-with-literals: true
respect-parameter-content: true
filter:
endpoints: ["POST /users", "GET /users/{id}"]
example-generation:
Expand Down Expand Up @@ -125,6 +126,24 @@ api:
Enables exploring readonly schemas in OpenAPI specifications.
</ParamField>

<ParamField path="settings.respect-parameter-content" type="boolean" default="false" toc={true}>
Types a header parameter from the schema under its JSON `content` media type instead of falling back to `string`. OpenAPI allows a parameter to describe its value with a `content` map rather than `schema`, which is how a header carrying a JSON-encoded object is expressed:

```yaml
- name: X-Plant-Filter
in: header
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/PlantFilter"
```

With this setting enabled, that header is typed as `PlantFilter` in generated SDKs, and the API Reference renders it as an object with per-field playground inputs. The setting is off by default because enabling it changes generated SDK method signatures.

Query parameters are unaffected: one declared with `content` stays a `string`, since Fern serializes object query parameters as deep key-value pairs rather than a single JSON-encoded value.
</ParamField>

<ParamField path="settings.respect-forward-compatible-enums" type="boolean" default="false" toc={true}>
Enables respecting forward compatible enums in OpenAPI specifications.
</ParamField>
Expand Down
Loading