-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better support of inline allOf/anyOf/oneOf schemas (#14887)
* better support of inilne allof schemas * add test file * better handling of anyof, oneof inline schemas * update samples * add tests for nested anyof * better code format
- Loading branch information
Showing
9 changed files
with
188 additions
and
122 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
56 changes: 56 additions & 0 deletions
56
modules/openapi-generator/src/test/resources/3_0/inline_model_allof_propertyof_oneof.yaml
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,56 @@ | ||
openapi: 3.0.1 | ||
info: | ||
title: ping test | ||
version: '1.0' | ||
servers: | ||
- url: 'http://localhost:8000/' | ||
paths: | ||
/ping: | ||
get: | ||
operationId: pingGet | ||
responses: | ||
'201': | ||
description: OK | ||
components: | ||
schemas: | ||
Order: | ||
title: Pet Order | ||
description: An order for a pets from the pet store | ||
allOf: | ||
- $ref: "#/components/schemas/Tag" | ||
- type: object | ||
properties: | ||
length: | ||
type: integer | ||
format: int64 | ||
shipDate: | ||
type: string | ||
format: date-time | ||
inline_oneof: | ||
oneOf: | ||
- $ref: "#/components/schemas/Tag" | ||
- $ref: "#/components/schemas/Filter" | ||
inline_model: | ||
properties: | ||
something: | ||
type: string | ||
Tag: | ||
title: Pet Tag | ||
description: A tag for a pet | ||
type: object | ||
properties: | ||
id: | ||
type: integer | ||
format: int64 | ||
name: | ||
type: string | ||
Filter: | ||
title: Pet Tag | ||
description: A tag for a pet | ||
type: object | ||
properties: | ||
fid: | ||
type: integer | ||
format: int64 | ||
fname: | ||
type: string |
16 changes: 16 additions & 0 deletions
16
modules/openapi-generator/src/test/resources/3_0/nested_anyof.yaml
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,16 @@ | ||
openapi: 3.0.0 | ||
info: | ||
version: '1.0.0' | ||
title: 'Problem example with nested anyOf' | ||
paths: {} | ||
components: | ||
schemas: | ||
NullOne: | ||
enum: | ||
- null | ||
SomeData: | ||
anyOf: | ||
- anyOf: | ||
- type: string | ||
- type: integer | ||
- $ref: '#/components/schemas/NullOne' |
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
Oops, something went wrong.