Skip to content

Commit 786d6a7

Browse files
committed
move location of parameters: [null] info
1 parent 117ddfa commit 786d6a7

File tree

2 files changed

+33
-85
lines changed

2 files changed

+33
-85
lines changed

fern/products/api-def/openapi-pages/extensions/ignore.mdx

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
---
22
title: Ignoring elements
3-
description: Skip reading endpoints, schemas, or properties using the `x-fern-ignore` extension
3+
description: Skip reading endpoints, schemas, properties, or parameters using the `x-fern-ignore` extension
44
---
55

6-
If you want Fern to skip reading any endpoints, schemas, or properties, use the `x-fern-ignore` extension.
6+
If you want Fern to skip reading any endpoints, schemas, properties, or parameters, use the `x-fern-ignore` extension.
7+
8+
## Ignore an endpoint
79

810
To skip an endpoint, add `x-fern-ignore: true` at the operation level.
911

@@ -14,6 +16,7 @@ paths:
1416
x-fern-ignore: true
1517
...
1618
```
19+
## Ignore a schema
1720

1821
To skip a schema, add `x-fern-ignore: true` at the schema level.
1922

@@ -25,6 +28,7 @@ components:
2528
...
2629
```
2730

31+
## Ignore a property
2832
To skip a property within a schema, add `x-fern-ignore: true` at the property level.
2933

3034
```yaml title="x-fern-ignore at property level in openapi.yml" {9}
@@ -39,3 +43,30 @@ components:
3943
x-fern-ignore: true
4044
type: string
4145
```
46+
47+
## Ignore a parameter
48+
49+
To skip a parameter, add `x-fern-ignore: true` at the parameter level.
50+
```yaml title="x-fern-ignore at parameter level in openapi.yml" {7}
51+
paths:
52+
/users:
53+
get:
54+
parameters:
55+
- name: internalParam
56+
in: query
57+
x-fern-ignore: true
58+
schema:
59+
type: string
60+
```
61+
62+
<Tip>
63+
To skip a parameter without modifying your base spec, use `null` values in your [overrides file](/api-definitions/overview/overrides) to delete parameters:
64+
65+
```yaml title="overrides.yml" {5}
66+
paths:
67+
"/users":
68+
get:
69+
parameters:
70+
- null # Deletes the first parameter from base spec
71+
```
72+
</Tip>

fern/products/api-def/openapi-pages/extensions/parameter-names.mdx

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -63,86 +63,3 @@ paths:
6363
type: string
6464
required: false
6565
```
66-
67-
## Delete parameters with null overrides
68-
69-
You can use explicit `null` values in your overrides file to delete parameters from the base specification. This is useful when:
70-
71-
- Resolving duplicate identifier conflicts between query parameters and request body properties
72-
- Removing deprecated or unnecessary parameters from the SDK
73-
- Simplifying the SDK interface by hiding internal parameters
74-
75-
<Warning>
76-
Deleting parameters is a breaking change. Parameters removed via null overrides will not be available in the generated SDK, even though they exist in the base OpenAPI specification.
77-
</Warning>
78-
79-
### Delete a single parameter
80-
81-
To delete the first parameter from an endpoint, use `parameters: [null]` in your overrides file:
82-
83-
```yaml title="overrides.yml" {5-6}
84-
paths:
85-
"/edge-config":
86-
post:
87-
x-fern-sdk-group-name: edgeConfig
88-
x-fern-sdk-method-name: create
89-
parameters:
90-
- null
91-
```
92-
93-
This removes the first parameter defined in the base specification for this endpoint.
94-
95-
### Delete multiple parameters
96-
97-
To delete multiple parameters, add multiple `null` entries:
98-
99-
```yaml title="overrides.yml" {5-8}
100-
paths:
101-
"/users":
102-
get:
103-
x-fern-sdk-group-name: users
104-
x-fern-sdk-method-name: list
105-
parameters:
106-
- null # Deletes first parameter
107-
- null # Deletes second parameter
108-
```
109-
110-
### Real-world example: Resolving duplicate identifiers
111-
112-
A common use case is resolving duplicate identifier errors when a query parameter and request body property have the same name. In this example, both the query parameter `slug` and the request body property `slug` would cause a TypeScript compilation error:
113-
114-
<CodeGroup>
115-
```yaml title="openapi.yml"
116-
paths:
117-
"/edge-config":
118-
post:
119-
operationId: create_edge_config
120-
parameters:
121-
- name: slug
122-
in: query
123-
description: "The Team slug"
124-
schema:
125-
type: string
126-
requestBody:
127-
content:
128-
application/json:
129-
schema:
130-
type: object
131-
properties:
132-
slug:
133-
type: string
134-
description: "The Edge Config slug"
135-
```
136-
137-
```yaml title="overrides.yml"
138-
paths:
139-
"/edge-config":
140-
post:
141-
x-fern-sdk-group-name: edgeConfig
142-
x-fern-sdk-method-name: create
143-
parameters:
144-
- null # Removes the query parameter slug
145-
```
146-
</CodeGroup>
147-
148-
After applying the override, the generated SDK will only include the request body `slug` property, eliminating the duplicate identifier error.

0 commit comments

Comments
 (0)