@Schema oneOf, anyOf, etc. and better support for inheritance
See original GitHub issueCan we use polymorphism features like oneOf, anyOf etc with Springfox?
@ApiResponse( content = @Content(
mediaType = MediaType.APPLICATION_JSON_VALUE,
schema = @Schema(oneOf = { Bird.class, Cat.class })) )
@PostMapping( path = "animals", produces = "application/json" )
ResponseEntity<IAnimal> echoAnimal( @RequestBody IAnimal animal );
I used io.swagger.v3.oas.annotations.responses.ApiResponse
. But did not work. Can anyone please help me to do it?
Note: I am using springfox-boot-starter:3.0.0-SNAPSHOT
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
oneOf, anyOf, allOf, not - Swagger
Use the oneOf keyword to ensure the given data is valid against one of the specified schemas. ... The example above shows how...
Read more >Fixed support for oneOf and anyOf to produce the right result ...
Referenced in this issue: RicoSuter/NSwag#2991 The only valid solution to generation of classes in C# to support anyOf and oneOf, is to merge...
Read more >"extends"/"allOf" and schema inheritance - Google Groups
The core of inheritance is that "B extends A" means that "Every valid B is also a valid A". So, wherever you use...
Read more >Proper use of polymorphism / inheritance in Open API 3
To avoid redundancy, the discriminator MAY be added to a parent schema definition, and all schemas comprising the parent schema in an allOf ......
Read more >Class inheritance and polymorphism in JSON schema
The inheritance is achieved in JSON by the keyword allOf. This keyword validates the value against all the subschemas. In the sub class ......
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
Not yet. This will be available in the next release
Yes will be pushing it today! 🎉