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

NPE when the input open API file is empty #872

Closed
hemchan opened this issue Oct 12, 2018 · 2 comments
Closed

NPE when the input open API file is empty #872

hemchan opened this issue Oct 12, 2018 · 2 comments

Comments

@hemchan
Copy link

hemchan commented Oct 12, 2018

Hi team,

Thanks for the nice project.
I got an null pointer exception when using the empty file.

Below is the error:
1258 [main] ERROR io.swagger.parser.SwaggerCompatConverter - failed to read resource listing
java.lang.NullPointerException
at io.swagger.parser.SwaggerCompatConverter.readResourceListing(SwaggerCompatConverter.java:213)
at io.swagger.parser.SwaggerCompatConverter.read(SwaggerCompatConverter.java:123)
at io.swagger.parser.SwaggerCompatConverter.readWithInfo(SwaggerCompatConverter.java:94)
at io.swagger.parser.SwaggerParser.readWithInfo(SwaggerParser.java:42)
at io.swagger.v3.parser.converter.SwaggerConverter.readLocation(SwaggerConverter.java:92)

Thanks,
Hemchand

@ymohdriz
Copy link
Contributor

Hi HemChand,

I tried the scenario and it returns the expected null as the input file has no content.
What you have mentioned in this issue is the error log which can be avoided, let me raise a PR to avoid this NPE.

Thanks,
Mohamed Rizwan

This was referenced Oct 12, 2018
@gracekarina
Copy link
Contributor

fixed by #876

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants