[BUG] OpenAPI 4.0.2 not able to generate anyOf models.
See original GitHub issueDescription
I have created a swagger file openapi: 3.0.0
having Account and Contact as references in anyOf something like this:
anyOf:
- $ref: "#/components/schemas/Account"
- $ref: "#/components/schemas/Contact"
openapi-generator version
4.0.2
Steps to reproduce
After running mvn generate-sources
command swagger generates models in /target folder. The issue here is that swagger is not able to generate class AnyOfAccountContact
which it should be.
The error looks like this:
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:26 (5 by maintainers)
Top Results From Across the Web
OpenAPI models not being generated when using oneOf
OpenAPI models not being generated when using oneOf ... I am using OpenAPI+OpenAPI-generator with spring boot, and trying to use the schema oneof ......
Read more >OpenAPI Specification - Version 3.0.3 - Swagger
The OpenAPI Specification defines a standard interface to RESTful APIs which ... Models are defined using the Schema Object, which is an extended...
Read more >Documentation for the java Generator
Select the complementary documentation annotation library. none: Do not annotate Model and Api with complementary annotations. swagger1 ...
Read more >Bug 53190 – openapi.json leads to unknown base type error ...
json, so: 1. The error is in the OpenAPITools/openapi-generator, not in OpenAPI. 2. I can successfully build the Java client using https:// ...
Read more >Getting started tutorial: Using Stoplight Studio to create an ...
You can create an OpenAPI specification document in several ways: (a) you can ... The left pane says, “You do not have any...
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 Free
Top 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
I have the same issue. Generating for Javascript. AnyOf file which is required in the model just doesn’t exist. Looks like the generator does not generate it. No errors and warnings during the generation process.
Doesn’t solves the problem
Same bug persists when generating java client with version 5.4