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
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
Generating python client code throws java.util.NoSuchElementException with latest container image. With v7.5.0 it does not throw this exception, but forgets a schema attribute to be generated in from_dict method in model description.
[main] WARN o.o.codegen.DefaultCodegen - Generation using 3.1.0 specs is in development and is not officially supported yet. If you would like to expedite development, please consider woking on the open issues in the 3.1.0 project: https://github.com/orgs/OpenAPITools/projects/4/vi
ews/1 and reach out to our team on Slack at https://join.slack.com/t/openapi-generator/shared_invite/zt-12jxxd7p2-XUeQM~4pzsU9x~eGLQqX2g
[main] INFO o.o.codegen.DefaultGenerator - Generating with dryRun=false
[main] INFO o.o.c.ignore.CodegenIgnoreProcessor - Output directory (/src/generated) does not exist, or is inaccessible. No file (.openapi-generator-ignore) will be evaluated.
[main] INFO o.o.codegen.DefaultGenerator - OpenAPI Generator: python (client)
[main] INFO o.o.codegen.DefaultGenerator - Generator 'python' is considered stable.
[main] INFO o.o.c.l.AbstractPythonCodegen - Environment variable PYTHON_POST_PROCESS_FILE not defined so the Python code may not be properly formatted. To define it, try 'export PYTHON_POST_PROCESS_FILE="/usr/local/bin/yapf -i"' (Linux/Mac)
[main] INFO o.o.c.l.AbstractPythonCodegen - NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI).
[main] INFO o.o.c.languages.PythonClientCodegen - Environment variable PYTHON_POST_PROCESS_FILE not defined so the Python code may not be properly formatted. To define it, try 'export PYTHON_POST_PROCESS_FILE="/usr/local/bin/yapf -i"' (Linux/Mac)
[main] INFO o.o.c.languages.PythonClientCodegen - NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI).
[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(Unknown Source)
at java.base/java.util.LinkedHashMap$LinkedKeyIterator.next(Unknown Source)
at org.openapitools.codegen.utils.ModelUtils.getType(ModelUtils.java:2124)
at org.openapitools.codegen.utils.ModelUtils.isArraySchema(ModelUtils.java:588)
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.normalizeProperties(OpenAPINormalizer.java:599)
at org.openapitools.codegen.OpenAPINormalizer.normalizeSchema(OpenAPINormalizer.java:555)
at org.openapitools.codegen.OpenAPINormalizer.normalizeComponentsSchemas(OpenAPINormalizer.java:484)
at org.openapitools.codegen.OpenAPINormalizer.normalize(OpenAPINormalizer.java:287)
at org.openapitools.codegen.DefaultGenerator.configureGeneratorProperties(DefaultGenerator.java:274)
at org.openapitools.codegen.DefaultGenerator.generate(DefaultGenerator.java:1217)
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)
[main] INFO o.o.codegen.InlineModelResolver - Inline schema created as FilterData_1. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings FilterData_1=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMa
pping option (--inline-schema-name-mappings FilterData_1=NewModel,ModelA=NewModelA in CLI).
Exception in thread "main" java.util.NoSuchElementException
at java.base/java.util.LinkedHashMap$LinkedHashIterator.nextNode(Unknown Source)
at java.base/java.util.LinkedHashMap$LinkedKeyIterator.next(Unknown Source)
at org.openapitools.codegen.utils.ModelUtils.getType(ModelUtils.java:2124)
at org.openapitools.codegen.utils.ModelUtils.isArraySchema(ModelUtils.java:588)
at org.openapitools.codegen.InlineModelResolver.gatherInlineModels(InlineModelResolver.java:341)
at org.openapitools.codegen.InlineModelResolver.gatherInlineModels(InlineModelResolver.java:407)
at org.openapitools.codegen.InlineModelResolver.gatherInlineModels(InlineModelResolver.java:296)
at org.openapitools.codegen.InlineModelResolver.flattenComponents(InlineModelResolver.java:656)
at org.openapitools.codegen.InlineModelResolver.flatten(InlineModelResolver.java:109)
at org.openapitools.codegen.DefaultGenerator.configureGeneratorProperties(DefaultGenerator.java:287)
at org.openapitools.codegen.DefaultGenerator.generate(DefaultGenerator.java:1217)
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)
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)
Bug Report Checklist
Description
Generating python client code throws
java.util.NoSuchElementException
with latest container image. With v7.5.0 it does not throw this exception, but forgets a schema attribute to be generated infrom_dict
method in model description.openapi-generator version
7.5.0 or this container image
OpenAPI declaration file content or url
broken: https://gist.github.com/rei-ber/88b32163bb2d04779f28a267678582cd
no exception with latest image and available attribute but still missing attribute with v7.5.0: https://gist.github.com/rei-ber/5fe2c4f3f056cd217eaafff12010272a
Generation Details
Podman 5.0.2
Steps to reproduce
outputs:
and
outputs nothing. I expect this output:
Related issues/PRs
Suggest a fix
If I remove one of the data schemas, in this case
UsecaseData
, it works, but actually is not a fix for me. Using the other schema uploaded as a gist:outputs:
But with v7.5.0 it still does not work:
Another fix is, to change the spec version to
3.0.3
. Then the broken spec works with latest container image and v7.5.0.The text was updated successfully, but these errors were encountered: