-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[JAVA] Nullpointer Exception generating Jaxrs #6511
Comments
@maha79 thanks for reporting the issue. Do you mind submitting a PR with the suggested fix? |
I'm seeing the same issue, I tracked down these PR's from the release notes that seem to concern the importMappings (which i think is causing the problem). I tried adding
|
After further investigation the line in my code that results in a null getting into the imports set is As maha79 identified this occurs at L2582
The toString for this instance is Looking a little further, This is new code and was added as part of #5891 I reverted this and validated that my build passes afterwards. |
@set321go do you mind submitting a PR with a proper null check when you've time? or share a spec so that we can more easily reproduce the issue while working on a fix later. |
This should have been fixed in #6079. |
@akhalikov thanks for confirming the issue has been addressed. |
Description
When generating JaxRS code, I run in a Nullpointer exception.
This is caused by a string array within the body parameter in the json description.
The problem is in AbstractJavaCodegen Method
There is a null value in the list of imports to check. This in turn results from this code in DefaultCodegen.java (Line 2581):
innerCp is not a complexType is this case what causes NULL to be added to the import.
Swagger-codegen version
2.2.3
Swagger declaration file content or url
Command line used for generation
Suggest a fix/enhancement
Add a null check to the needToImport method.
The text was updated successfully, but these errors were encountered: