Open dcolens opened 7 years ago
Did more testing and this is the line that causes the crash in the swagger.json file (note that the file loads fine in both swagger editor and viewer):
"parameters": [
{
"$ref": "#/paths/~1api~1v2~1services~1%7Bname%7D/put/parameters/1"
},
If I replace the $ref by the corresponding block, it goes fine.
Me too, but with objc
Exception: null
at io.swagger.codegen.DefaultGenerator.processOperation(DefaultGenerator.java:796)
at io.swagger.codegen.DefaultGenerator.processPaths(DefaultGenerator.java:688)
at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:376)
at io.swagger.codegen.cmd.Generate.run(Generate.java:223)
at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:36)
Caused by: java.lang.NullPointerException
at io.swagger.codegen.languages.ObjcClientCodegen.setParameterExampleValue(ObjcClientCodegen.java:710)
at io.swagger.codegen.DefaultCodegen.fromParameter(DefaultCodegen.java:2351)
at io.swagger.codegen.DefaultCodegen.fromOperation(DefaultCodegen.java:1961)
at io.swagger.codegen.DefaultGenerator.processOperation(DefaultGenerator.java:744)
... 4 more
Please try 2.2.2, released today
Description
Getting Exception in thread "main" java.lang.NullPointerException at io.swagger.codegen.DefaultGenerator.generateParameterId(DefaultGenerator.java:832) at io.swagger.codegen.DefaultGenerator.processOperation(DefaultGenerator.java:756) at io.swagger.codegen.DefaultGenerator.processPaths(DefaultGenerator.java:725) at io.swagger.codegen.DefaultGenerator.generateApis(DefaultGenerator.java:354) at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:664) at io.swagger.codegen.cmd.Generate.run(Generate.java:234) at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:41) when generating client python code from Master
Swagger-codegen version
Master
Swagger declaration file content or url
the spec is very long, I'll try to see if I can reduce its size, I suspect the ref "$ref": "#/paths/~1api~1v2~1services/post/responses/200/schema" in the response body causes it.
Command line used for generation
java -jar ./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i ../swagger-combine/swagger.json -l python -o ../swagger-combine/test/
Steps to reproduce
just ran the above command.
Related issues
could not find any.
Suggest a Fix
Looks like https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java#L754 checks if path.getParameters() is not null but not if it does not contain null entries.