-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4637 from GooDer/openApi-3.1-ComposedSchema-fix
Fix #4634: unite processing of allOf, anyOf, oneOf relation so it wil…
- Loading branch information
Showing
3 changed files
with
109 additions
and
9 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
85 changes: 85 additions & 0 deletions
85
modules/swagger-core/src/test/resources/specFiles/3.1.0/composed-schema-3.1.json
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,85 @@ | ||
{ | ||
"components": { | ||
"schemas": { | ||
"SomeChild1ImplObject": { | ||
"allOf": [ | ||
{ | ||
"$ref": "#/components/schemas/SomeChildObject" | ||
} | ||
] | ||
}, | ||
"SomeChild2ImplObject": { | ||
"allOf": [ | ||
{ | ||
"$ref": "#/components/schemas/SomeChildObject" | ||
} | ||
] | ||
}, | ||
"SomeChildObject": { | ||
"description": "Some child object" | ||
}, | ||
"SomeParentObject": { | ||
"description": "Some parent object", | ||
"properties": { | ||
"id": { | ||
"description": "id", | ||
"format": "int64", | ||
"type": "integer" | ||
}, | ||
"other": { | ||
"description": "other", | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/components/schemas/SomeChild1ImplObject" | ||
}, | ||
{ | ||
"$ref": "#/components/schemas/SomeChild2ImplObject" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"info": { | ||
"title": "OpenAPI definition", | ||
"version": "v0" | ||
}, | ||
"openapi": "3.1.0", | ||
"paths": { | ||
"/some/call": { | ||
"get": { | ||
"description": "Some operation description", | ||
"operationId": "getSome", | ||
"responses": { | ||
"200": { | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/SomeParentObject" | ||
} | ||
} | ||
}, | ||
"description": "OK" | ||
} | ||
}, | ||
"summary": "Some summary", | ||
"tags": [ | ||
"Some" | ||
] | ||
} | ||
} | ||
}, | ||
"servers": [ | ||
{ | ||
"description": "Generated server url", | ||
"url": "http://localhost:8080" | ||
} | ||
], | ||
"tags": [ | ||
{ | ||
"description": "some actions", | ||
"name": "Some" | ||
} | ||
] | ||
} |