-
-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(schema): fix OASv3 schema generation fails when model used in @OneOf
has kind property Closes: #2413
- Loading branch information
Showing
14 changed files
with
168 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
packages/specs/schema/test/integrations/__snapshots__/discriminator.integration.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Discriminator with kind property should generate the spec 1`] = ` | ||
Object { | ||
"components": Object { | ||
"schemas": Object { | ||
"FirstImpl": Object { | ||
"properties": Object { | ||
"kind": Object { | ||
"enum": Array [ | ||
"json", | ||
], | ||
"type": "string", | ||
}, | ||
"type": Object { | ||
"enum": Array [ | ||
"one", | ||
"two", | ||
], | ||
"example": "one", | ||
"type": "string", | ||
}, | ||
}, | ||
"type": "object", | ||
}, | ||
"ParentModel": Object { | ||
"properties": Object { | ||
"test": Object { | ||
"discriminator": Object { | ||
"propertyName": "type", | ||
}, | ||
"oneOf": Array [ | ||
Object { | ||
"$ref": "#/components/schemas/FirstImpl", | ||
}, | ||
Object { | ||
"$ref": "#/components/schemas/SecondImpl", | ||
}, | ||
], | ||
"required": Array [ | ||
"type", | ||
], | ||
}, | ||
}, | ||
"type": "object", | ||
}, | ||
"SecondImpl": Object { | ||
"properties": Object { | ||
"prop": Object { | ||
"type": "string", | ||
}, | ||
"type": Object { | ||
"enum": Array [ | ||
"one", | ||
"two", | ||
], | ||
"example": "two", | ||
"type": "string", | ||
}, | ||
}, | ||
"type": "object", | ||
}, | ||
}, | ||
}, | ||
"paths": Object { | ||
"/test": Object { | ||
"get": Object { | ||
"operationId": "testGet", | ||
"parameters": Array [], | ||
"responses": Object { | ||
"200": Object { | ||
"content": Object { | ||
"application/json": Object { | ||
"schema": Object { | ||
"items": Object { | ||
"$ref": "#/components/schemas/ParentModel", | ||
}, | ||
"type": "array", | ||
}, | ||
}, | ||
}, | ||
"description": "Success", | ||
}, | ||
}, | ||
"tags": Array [ | ||
"Test", | ||
], | ||
}, | ||
}, | ||
}, | ||
"tags": Array [ | ||
Object { | ||
"name": "Test", | ||
}, | ||
], | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters