Hi
I currently facing this stack trace
java.lang.RuntimeException: Could not process operation:
Tag: AssetGroups
Operation: addAssets
Resource: put /api/v2/assetGroups/{id}/assetList
Definitions: {Addresses=io.swagger.models.ModelImpl@9901aa0,
AppHost=io.swagger.models.ModelImpl@8456d641, ....
Exception: null
at io.swagger.codegen.DefaultGenerator.processOperation(DefaultGenerator.java:861)
at io.swagger.codegen.DefaultGenerator.processPaths(DefaultGenerator.java:763)
at io.swagger.codegen.DefaultGenerator.generateApis(DefaultGenerator.java:388)
at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:700)
after upgrading from swagger-codegen-maven-plugin 2.2.2 to 2.2.3 where I generate java source from swagger spec
Need suggestion on how to look for abnormalities in my swagger spec file which can cause this issue ( or this can just be regression )
Thanks
2.2.3
Also seeing this issue with swagger-codegen 2.2.3.
The line at the top of your is thrown here.
If you think your swagger spec is failing validation now, you can validate via command line.
This is the command (installed from brew install swagger-codegen on mac)
$ swagger-codegen help validate
NAME
swagger-codegen-cli validate - Validate specification
SYNOPSIS
swagger-codegen-cli validate (-i <spec file> | --input-spec <spec file>)
OPTIONS
-i <spec file>, --input-spec <spec file>
location of the swagger spec, as URL or file (required)
If your spec passes validation, I'd recommend debugging locally. The maven plugin is just a maven options wrapper around swagger-codgen's core, which you can also access via swagger-codegen-cli. Here are the steps if you're not familiar with it (I'm assuming you have IntelliJ available if you're using the maven plugin):
git checkout v2.2.3mvn clean package -Dmaven.test.skip=true -DskipTestsexport JAVA_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,address=5009,suspend=y"address from the previous bullet (5009)DefaultGenerator.java
java $JAVA_OPTS -jar ./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar \
generate -i yourswagger.json -l java -o ./output #etc
JAVA_OPTS variable or close your shell session 馃拑 For 2.2.3, swagger parser and swagger core dependencies were updated (commit). It's possible the NPE is from a type pulled in from there. I did some investigation into DefaultGenerator.java changes between 2.2.2 and 2.2.3, and I don't see anywhere that a NPE would have been introduced.
I hope that helps.
Looks like it has been fixed right after v2.2.3 release.
https://github.com/swagger-api/swagger-codegen/pull/6079/
The coming v2.3.0 should be fine.
@codegen dev, any plan to backport this fix to 2.2x branch and release with 2.2.4?
Most helpful comment
Also seeing this issue with swagger-codegen 2.2.3.