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

NullPointerException when run "validate" with OAS2 spec #67

Closed
ackintosh opened this issue May 16, 2018 · 9 comments
Closed

NullPointerException when run "validate" with OAS2 spec #67

ackintosh opened this issue May 16, 2018 · 9 comments

Comments

@ackintosh
Copy link
Contributor

ackintosh commented May 16, 2018

Description
$ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar validate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
Validating spec file (modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml)
Exception in thread "main" java.lang.NullPointerException
        at java.util.HashSet.<init>(HashSet.java:118)
        at org.openapitools.codegen.cmd.Validate.run(Validate.java:44)
        at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:52)
openapi-generator version

Latest master

Suggest a fix/enhancement

It may caused by SwaggerConverter as the converter doesn't set message.

In case of parsing OAS3, OpenAPIDeserializer sets message.

I think that SwaggerConverter should set the message as well.

@ackintosh
Copy link
Contributor Author

I'll file the PR that fixes the issue to https://github.com/OpenAPITools/swagger-parser

@jmini
Copy link
Member

jmini commented May 16, 2018

I would appreciate if you could also file an issue in the original swagger-parser project. I am open for discussion and I have opened #68 for that.

@jmini
Copy link
Member

jmini commented May 17, 2018

This depends from swagger-api/swagger-parser#710

@ackintosh
Copy link
Contributor Author

ackintosh commented May 17, 2018

I changed my mind, I'll file a PR to the original swagger-parser. 💡

@ackintosh
Copy link
Contributor Author

@jmini
Copy link
Member

jmini commented May 22, 2018

With #123 we use swagger-parser version 2.0.1-SNAPSHOT. This should fix this issue.

@ackintosh
Copy link
Contributor Author

Confirmed this issue is fixed with #123 👍 This issue will be closed after 3.0.0 release.

@jmini
Copy link
Member

jmini commented May 25, 2018

Anything left to do here? or can we close this issue?

@ackintosh
Copy link
Contributor Author

Nothing to do for this issue. 🎉

nilskuhn pushed a commit to nilskuhn/openapi-generator that referenced this issue Apr 6, 2023
nilskuhn pushed a commit to nilskuhn/openapi-generator that referenced this issue Apr 6, 2023
nilskuhn pushed a commit to nilskuhn/openapi-generator that referenced this issue Apr 6, 2023
nilskuhn pushed a commit to nilskuhn/openapi-generator that referenced this issue Apr 6, 2023
nilskuhn pushed a commit to nilskuhn/openapi-generator that referenced this issue Apr 6, 2023
nilskuhn pushed a commit to nilskuhn/openapi-generator that referenced this issue Apr 6, 2023
nilskuhn pushed a commit to nilskuhn/openapi-generator that referenced this issue Apr 6, 2023
nilskuhn pushed a commit to nilskuhn/openapi-generator that referenced this issue Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants