Skip to content

Commit 128b038

Browse files
committed
add defaultMaping to discriminator
1 parent 6a49852 commit 128b038

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

packages/core/src/types/oas3_2.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,14 @@ const MediaType: NodeType = {
165165
},
166166
};
167167

168+
const Discriminator: NodeType = {
169+
...Oas3_1Types.Discriminator,
170+
properties: {
171+
...Oas3_1Types.Discriminator.properties,
172+
defaultMapping: { type: 'string' },
173+
},
174+
};
175+
168176
const Example: NodeType = {
169177
...Oas3_1Types.Example,
170178
properties: {
@@ -184,5 +192,6 @@ export const Oas3_2Types = {
184192
Parameter,
185193
Response,
186194
MediaType,
195+
Discriminator,
187196
Example,
188197
} as const;

packages/core/src/typings/openapi.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ export interface Oas3Webhooks<T extends Oas3Schema | Oas3_1Schema> {
215215
export interface Oas3Discriminator {
216216
propertyName: string;
217217
mapping?: { [name: string]: string };
218+
defaultMapping?: string; // added in OAS 3.2
218219
'x-explicitMappingOnly'?: boolean;
219220
}
220221

0 commit comments

Comments
 (0)