[BUG] Python generator emits java.lang.RuntimeException: Could not process model
Created by: dkliban
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.