You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like there is a problem with anyOf in the contect of response's. When I try to generate my API I get an exception. Excerpt of the OpenAPI file: myapi.json
From Version 7.6
[main] ERROR o.o.codegen.DefaultGenerator - An exception occurred in OpenAPI Normalizer. Please report the issue via https://github.com/openapitools/openapi-generator/issues/new/:
[main] ERROR o.o.codegen.DefaultGenerator - An exception occurred in OpenAPI Normalizer. Please report the issue via https://github.com/openapitools/openapi-generator/issues/new/:
java.util.NoSuchElementException
at java.base/java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:758)
at java.base/java.util.LinkedHashMap$LinkedKeyIterator.next(LinkedHashMap.java:778)
at org.openapitools.codegen.utils.ModelUtils.getType(ModelUtils.java:2141)
at org.openapitools.codegen.utils.ModelUtils.isArraySchema(ModelUtils.java:594)
at org.openapitools.codegen.OpenAPINormalizer.normalizeSchema(OpenAPINormalizer.java:512)
at org.openapitools.codegen.OpenAPINormalizer.normalizeAnyOf(OpenAPINormalizer.java:659)
at org.openapitools.codegen.OpenAPINormalizer.normalizeSchema(OpenAPINormalizer.java:522)
at org.openapitools.codegen.OpenAPINormalizer.normalizeContent(OpenAPINormalizer.java:367)
at org.openapitools.codegen.OpenAPINormalizer.normalizeResponses(OpenAPINormalizer.java:438)
at org.openapitools.codegen.OpenAPINormalizer.normalizePaths(OpenAPINormalizer.java:330)
at org.openapitools.codegen.OpenAPINormalizer.normalize(OpenAPINormalizer.java:286)
at org.openapitools.codegen.DefaultGenerator.configureGeneratorProperties(DefaultGenerator.java:279)
at org.openapitools.codegen.DefaultGenerator.generate(DefaultGenerator.java:1289)
at org.openapitools.codegen.cmd.Generate.execute(Generate.java:535)
at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)
Exception in thread "main" java.util.NoSuchElementException
at java.base/java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:758)
at java.base/java.util.LinkedHashMap$LinkedKeyIterator.next(LinkedHashMap.java:778)
at org.openapitools.codegen.utils.ModelUtils.getType(ModelUtils.java:2141)
at org.openapitools.codegen.utils.ModelUtils.isArraySchema(ModelUtils.java:594)
at org.openapitools.codegen.InlineModelResolver.gatherInlineModels(InlineModelResolver.java:341)
at org.openapitools.codegen.InlineModelResolver.gatherInlineModels(InlineModelResolver.java:407)
at org.openapitools.codegen.InlineModelResolver.flattenContent(InlineModelResolver.java:471)
at org.openapitools.codegen.InlineModelResolver.flattenResponses(InlineModelResolver.java:555)
at org.openapitools.codegen.InlineModelResolver.flattenPaths(InlineModelResolver.java:149)
at org.openapitools.codegen.InlineModelResolver.flatten(InlineModelResolver.java:108)
at org.openapitools.codegen.DefaultGenerator.configureGeneratorProperties(DefaultGenerator.java:292)
at org.openapitools.codegen.DefaultGenerator.generate(DefaultGenerator.java:1289)
at org.openapitools.codegen.cmd.Generate.execute(Generate.java:535)
at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)
openapi-generator version
Get the same error 7.6 and 7.7-Snapshot
But not on 7.4 and 7.5
please give it a try with the latest master (snapshot version mentioned in the project's readme will be published later as part of the travis ci workflow)
Description
It seems like there is a problem with anyOf in the contect of response's. When I try to generate my API I get an exception. Excerpt of the OpenAPI file: myapi.json
From Version 7.6
openapi-generator version
Get the same error 7.6 and 7.7-Snapshot
But not on 7.4 and 7.5
OpenAPI declaration file content or url
myapi.json
Command line used for generation
openapi-generator-cli generate -g java -i myapi.json
running Fedora Linux
Steps to reproduce
run any generator with the attached myapi.json
Related issues/PRs
#18655
#18732
Suggest a fix/enhancement
Please add a more descriptive exception for similar issues.
The text was updated successfully, but these errors were encountered: