Skip to content

Commit

Permalink
Update .changeset/selfish-pandas-speak.md
Browse files Browse the repository at this point in the history
Add missing keywords for OAS 3.1.x (JSON Schema 2020-12)

Co-authored-by: Andrew Tatomyr <andrew.tatomyr@gmail.com>
  • Loading branch information
jeremyfiel and tatomyr committed Nov 6, 2024
1 parent 7463f90 commit 498f6b7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
5 changes: 2 additions & 3 deletions .changeset/selfish-pandas-speak.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
"@redocly/openapi-core": minor
"@redocly/cli": minor
"@redocly/openapi-core": patch
---

Update typings for OAS 3.0 and OAS 3.1 Schemas
Updated typings for OAS 3.0 and OAS 3.1 Schemas.
2 changes: 2 additions & 0 deletions packages/core/src/types/oas3_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ export const Schema: NodeType = {
const: null,
$comment: { type: 'string' },
'x-tags': { type: 'array', items: { type: 'string' } },
$dynamicAnchor: { type: 'string' },
$dynamicRef: { type: 'string' },
},
extensionsPrefix: 'x-',
};
Expand Down
11 changes: 10 additions & 1 deletion packages/core/src/typings/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ interface Oas3XSchemaBase {
format?: string;
externalDocs?: Oas3ExternalDocs;
discriminator?: Oas3Discriminator;
nullable?: boolean;

title?: string;
multipleOf?: number;
Expand Down Expand Up @@ -155,9 +154,19 @@ export interface Oas3Schema extends Oas3XSchemaBase {
anyOf?: Oas3Schema[];
allOf?: Oas3Schema[];
not?: Oas3Schema;
nullable?: boolean;
}

export interface Oas3_1Schema extends Oas3XSchemaBase {
$id?: string;
id?: string;
$anchor?: string;
$dynamicAnchor?: string;
$dynamicRef?: string;
definitions?: { [name: string]: Referenced<Oas3_1Schema> };
$defs?: { [name: string]: Referenced<Oas3_1Schema> };
$vocabulary?: { [uri: string]: boolean };
$comment?: string;
type?: string | string[];
properties?: { [name: string]: Referenced<Oas3_1Schema> };
additionalProperties?: boolean | Oas3_1Schema;
Expand Down

0 comments on commit 498f6b7

Please sign in to comment.