Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Python generator emits java.lang.RuntimeException: Could not process model #5081

Closed
dkliban opened this issue Jan 22, 2020 · 2 comments

Comments

@dkliban
Copy link
Contributor

dkliban commented Jan 22, 2020

Our schema is available here: https://docs.pulpproject.org/api.json

When I run the following command (v4.2.2) it works correctly:

podman run -u $(id -u) --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v4.2.2 generate -i https://docs.pulpproject.org/api.json -g python -o /local/pulpcore-client --additional-properties=packageName=pulpcore.client.pulpcore,projectName=pulpcore-client,packageVersion=3.0.0 --skip-validate-spec --strict-spec=false

When I run the latest, it does not work:

podman run -u $(id -u) --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -i https://docs.pulpproject.org/api.json -g python -o /local/pulpcore-client --additional-properties=packageName=pulpcore.client.pulpcore,projectName=pulpcore-client,packageVersion=3.0.0 --skip-validate-spec --strict-spec=false

It produces the following:

Exception in thread "main" java.lang.RuntimeException: Could not process model 'Task'.Please make sure that your schema is correct!
        at org.openapitools.codegen.DefaultGenerator.generateModels(DefaultGenerator.java:472)
        at org.openapitools.codegen.DefaultGenerator.generate(DefaultGenerator.java:923)
        at org.openapitools.codegen.cmd.Generate.run(Generate.java:416)
        at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:61)
Caused by: java.lang.NullPointerException
        at org.openapitools.codegen.languages.PythonClientCodegen.toExampleValueRecursive(PythonClientCodegen.java:833)
        at org.openapitools.codegen.languages.PythonClientCodegen.toExampleValueRecursive(PythonClientCodegen.java:752)
        at org.openapitools.codegen.languages.PythonClientCodegen.toExampleValueRecursive(PythonClientCodegen.java:795)
        at org.openapitools.codegen.languages.PythonClientCodegen.toExampleValue(PythonClientCodegen.java:700)
        at org.openapitools.codegen.DefaultCodegen.fromProperty(DefaultCodegen.java:2254)
        at org.openapitools.codegen.DefaultCodegen.addVars(DefaultCodegen.java:3968)
        at org.openapitools.codegen.DefaultCodegen.addVars(DefaultCodegen.java:3916)
        at org.openapitools.codegen.DefaultCodegen.fromModel(DefaultCodegen.java:2102)
        at org.openapitools.codegen.DefaultGenerator.processModels(DefaultGenerator.java:1166)
        at org.openapitools.codegen.DefaultGenerator.generateModels(DefaultGenerator.java:467)
        ... 3 more

This just started happening today. Everything was working yesterday.

@auto-labeler
Copy link

auto-labeler bot commented Jan 22, 2020

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

@dkliban
Copy link
Contributor Author

dkliban commented Jan 23, 2020

I just test this with the latest image published to Dockerhub and the problem has been resolved. I am going to close this issue.

@dkliban dkliban closed this as completed Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant