oneOf, anyOf not works
See original GitHub issueQ&A (please complete the following information)
- OS: macOS
- Browser: [chrome, safari]
- Method of installation: dist assets
- Swagger-UI version: 3.18.1
- Swagger/OpenAPI version: Swagger 2.0, OpenAPI 3.0
Content & configuration
oneOf, anyOf not works
Example Swagger/OpenAPI definition:
/v2/teams/{id}:
delete:
tags:
- Teams
summary: Delete a team
parameters:
- in: path
name: id
required: true
type: string
allowEmptyValue: false
responses:
204:
get:
tags:
- Teams
summary: Get a team by id
parameters:
- in: path
name: id
required: true
type: string
allowEmptyValue: false
responses:
200:
schema:
oneOf:
- $ref: "#/definitions/Team1"
- $ref: "#/definitions/Team2"
Expected behavior
oneOf, anyOf works
Screenshots
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
oneOf, anyOf, allOf, not - Swagger
The following JSON object is valid against both schemas, so the response body is incorrect – it should be valid against only one...
Read more >oneOf in Swagger schema does not work - Stack Overflow
oneOf is supported in OpenAPI version 3 ( openapi: 3.0.0 ), but not in Swagger version 2 ( swagger: '2.0' ). PaymentMethod: oneOf:...
Read more >Understanding JSON Schema 2020-12 documentation
allOf; anyOf; oneOf; not; Properties of Schema Composition. Illogical Schemas; Factoring Schemas. JSON Schema includes a few keywords for combining schemas ...
Read more >AllOf, AnyOf, OneOf - Liquid Technologies
The 3 keywords AnyOf, AllOf and OneOf work in the same way, ... the Additional Properties not), and if both of them validated...
Read more >Swagger UI - OneOf with discriminator didn't show schema
Hi, I'm trying this schema structure, but Swagger UI schema example don't show anything. Simple example: openapi: 3.0.2 servers: - url:
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for your support, will be looking forward to the release of this feature 😃
Glad we could help!
Closing this out in favor of #3803.