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

Added better null check for imports in codegen #6079

Merged
merged 2 commits into from
Jul 17, 2017
Merged

Added better null check for imports in codegen #6079

merged 2 commits into from
Jul 17, 2017

Conversation

Dschinghis-Kahn
Copy link
Contributor

Description of the PR

When generating client libs for the EVE Online ESI API a null pointer exception occured preventing the libs from being build.

Reproduce the error

git clone https://github.com/swagger-api/swagger-codegen
cd swagger-codegen
mvn clean package
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate
-i https://esi.tech.ccp.is/latest/swagger.json
-l java
-o samples/client/eve-online-esi-api/java

Fix

I traced the root cause of the null pointer exception and prevented it by a not-null-check when adding the object in question.

Caution: I have absolutely no idea what the code were I implemented the fix does!!!
Please check the fix for any side effects. I only tested the fix with the petstore and eve specs and both can build their client libs.

@wing328
Copy link
Contributor

wing328 commented Jul 17, 2017

@Dschinghis-Kahn I think doing a null check is reasonable. Thanks for contributing the fix.

@wing328 wing328 merged commit e8bdf71 into swagger-api:master Jul 17, 2017
@wing328 wing328 added this to the v2.3.0 milestone Jul 17, 2017
@wing328 wing328 changed the title Added not null check in code generator. Added better null check for imports in codegen Jul 17, 2017
@Dschinghis-Kahn Dschinghis-Kahn deleted the bugfix/eve-esi-api-produces-null-pointer-exception branch July 17, 2017 14:44
@bingshiao bingshiao mentioned this pull request Aug 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants