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
When I execute the code generation using version 3.0.8 is works just fine.
java -jar swagger-codegen-cli-3.0.8.jar generate -i TS29571_CommonData.yaml -l spring -o GENERATED_COMMON_08
However, when the same command is tried with latest version, it does not work.
java -jar swagger-codegen-cli-3.0.9.jar generate -i TS29571_CommonData.yaml -l spring -o GENERATED_COMMON_09
Corresponding logs can be seen below:
`
14:51:15.423 [Thread-1] WARN io.swagger.codegen.v3.generators.java.AbstractJavaCodegen - Double (reserved word) cannot be used as model name. Renamed to ModelDouble
Exception in thread "Thread-1" java.lang.RuntimeException: Could not process model 'PatchOperation'.Please make sure that your schema is correct!
at io.swagger.codegen.v3.DefaultGenerator.generateModels(DefaultGenerator.java:378)
at io.swagger.codegen.v3.DefaultGenerator.generate(DefaultGenerator.java:756)
at io.swagger.codegen.v3.cli.cmd.Generate.run(Generate.java:342)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at io.swagger.codegen.v3.generators.util.OpenAPIUtil.getSimpleRef(OpenAPIUtil.java:32)
at io.swagger.codegen.v3.generators.SchemaHandler.configureAnyOfModel(SchemaHandler.java:75)
at io.swagger.codegen.v3.generators.DefaultCodegenConfig.fromModel(DefaultCodegenConfig.java:1374)
at io.swagger.codegen.v3.generators.java.AbstractJavaCodegen.fromModel(AbstractJavaCodegen.java:895)
at io.swagger.codegen.v3.DefaultGenerator.processModels(DefaultGenerator.java:988)
at io.swagger.codegen.v3.DefaultGenerator.generateModels(DefaultGenerator.java:349)
14:51:15.423 [Thread-1] WARN io.swagger.codegen.v3.generators.java.AbstractJavaCodegen - Double (reserved word) cannot be used as model name. Renamed to ModelDouble
Exception in thread "Thread-1" java.lang.RuntimeException: Could not process model 'PatchOperation'.Please make sure that your schema is correct!
at io.swagger.codegen.v3.DefaultGenerator.generateModels(DefaultGenerator.java:378)
at io.swagger.codegen.v3.DefaultGenerator.generate(DefaultGenerator.java:756)
at io.swagger.codegen.v3.cli.cmd.Generate.run(Generate.java:342)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at io.swagger.codegen.v3.generators.util.OpenAPIUtil.getSimpleRef(OpenAPIUtil.java:32)
at io.swagger.codegen.v3.generators.SchemaHandler.configureAnyOfModel(SchemaHandler.java:75)
at io.swagger.codegen.v3.generators.DefaultCodegenConfig.fromModel(DefaultCodegenConfig.java:1374)
at io.swagger.codegen.v3.generators.java.AbstractJavaCodegen.fromModel(AbstractJavaCodegen.java:895)
at io.swagger.codegen.v3.DefaultGenerator.processModels(DefaultGenerator.java:988)
at io.swagger.codegen.v3.DefaultGenerator.generateModels(DefaultGenerator.java:349)
`
Description
When I execute the code generation using version 3.0.8 is works just fine.
java -jar swagger-codegen-cli-3.0.8.jar generate -i TS29571_CommonData.yaml -l spring -o GENERATED_COMMON_08
However, when the same command is tried with latest version, it does not work.
java -jar swagger-codegen-cli-3.0.9.jar generate -i TS29571_CommonData.yaml -l spring -o GENERATED_COMMON_09
Corresponding logs can be seen below:
`
14:51:15.423 [Thread-1] WARN io.swagger.codegen.v3.generators.java.AbstractJavaCodegen - Double (reserved word) cannot be used as model name. Renamed to ModelDouble
Exception in thread "Thread-1" java.lang.RuntimeException: Could not process model 'PatchOperation'.Please make sure that your schema is correct!
at io.swagger.codegen.v3.DefaultGenerator.generateModels(DefaultGenerator.java:378)
at io.swagger.codegen.v3.DefaultGenerator.generate(DefaultGenerator.java:756)
at io.swagger.codegen.v3.cli.cmd.Generate.run(Generate.java:342)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at io.swagger.codegen.v3.generators.util.OpenAPIUtil.getSimpleRef(OpenAPIUtil.java:32)
at io.swagger.codegen.v3.generators.SchemaHandler.configureAnyOfModel(SchemaHandler.java:75)
at io.swagger.codegen.v3.generators.DefaultCodegenConfig.fromModel(DefaultCodegenConfig.java:1374)
at io.swagger.codegen.v3.generators.java.AbstractJavaCodegen.fromModel(AbstractJavaCodegen.java:895)
at io.swagger.codegen.v3.DefaultGenerator.processModels(DefaultGenerator.java:988)
at io.swagger.codegen.v3.DefaultGenerator.generateModels(DefaultGenerator.java:349)
`
Corresponding API Element
Swagger-codegen version
3.0.9
Swagger declaration file content or url
https://github.com/jdegre/5GC_APIs
Common Data is giving the exception - Matching - Common Data
Command line used for generation
Below command works fine:
java -jar swagger-codegen-cli-3.0.8.jar generate -i TS29571_CommonData.yaml -l spring -o GENERATED_COMMON_08
Below line when tried with 3.0.9 breaks it:
14:51:15.423 [Thread-1] WARN io.swagger.codegen.v3.generators.java.AbstractJavaCodegen - Double (reserved word) cannot be used as model name. Renamed to ModelDouble
Exception in thread "Thread-1" java.lang.RuntimeException: Could not process model 'PatchOperation'.Please make sure that your schema is correct!
at io.swagger.codegen.v3.DefaultGenerator.generateModels(DefaultGenerator.java:378)
at io.swagger.codegen.v3.DefaultGenerator.generate(DefaultGenerator.java:756)
at io.swagger.codegen.v3.cli.cmd.Generate.run(Generate.java:342)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at io.swagger.codegen.v3.generators.util.OpenAPIUtil.getSimpleRef(OpenAPIUtil.java:32)
at io.swagger.codegen.v3.generators.SchemaHandler.configureAnyOfModel(SchemaHandler.java:75)
at io.swagger.codegen.v3.generators.DefaultCodegenConfig.fromModel(DefaultCodegenConfig.java:1374)
at io.swagger.codegen.v3.generators.java.AbstractJavaCodegen.fromModel(AbstractJavaCodegen.java:895)
at io.swagger.codegen.v3.DefaultGenerator.processModels(DefaultGenerator.java:988)
at io.swagger.codegen.v3.DefaultGenerator.generateModels(DefaultGenerator.java:349)
`
Steps to reproduce
The corresponding JAR's hwere downloaded from Maven Central https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/
Related issues/PRs
None
Suggest a fix/enhancement
It looks specific to handling of the anyOf allOf kind of tags.
The text was updated successfully, but these errors were encountered: