You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error java.lang.NullPointerException when generate API for Yandex Disk #177
I am want generate client for yandex api.
Use Docker
When run
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -i https://cloud-api.yandex.net/v1/schema/resources/v1/disk/resources -g rust -o /local/out/rust
Exception in thread "main" java.lang.NullPointerException
at io.swagger.v3.parser.converter.SwaggerConverter.convert(SwaggerConverter.java:422)
at io.swagger.v3.parser.converter.SwaggerConverter.convert(SwaggerConverter.java:144)
at io.swagger.v3.parser.converter.SwaggerConverter.readLocation(SwaggerConverter.java:93)
at io.swagger.parser.OpenAPIParser.readLocation(OpenAPIParser.java:19)
at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:516)
at org.openapitools.codegen.cmd.Generate.run(Generate.java:314)
at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:69)
Perhaps a different statement of the issue is that invalid or outdated swagger specs are not handled elegantly? I don't think that type of problem should manifest as a NPE.
Reacted by Alexander A., Victor Orlovsky, sunn and Amin Abbaspour
@andreevlex : my guess is that you now have an other issue (and an other stacktrace). Maybe this issue could be closed and a new one could be created with the issue that appears with the 3.2.1 release.
Activity
wing328 commentedon May 30, 2018
I got errors when loading the spec with https://editor.swagger.io. Please address those errors and try again.
jmini commentedon May 30, 2018
Your schema is in a very old swagger format:
{ "description": "Файлы и папки", "swaggerVersion": "1.2", "apis":If the swagger-parser does not support it, OpenAPI Generator can not do much about it.
Have you a possibility to convert your specification to OpenAPI version 2 or OpenAPI version 3?
ava57r commentedon May 30, 2018
It is not me scheme. I want create Rust crate for Yandex Disk API, but not want write boilerplate lot structs manual. You can close this issue.
jmini commentedon May 30, 2018
Maybe older version of Swagger-Parser can convert this old spec version to a newer one like
swagger: 2.0.bmordue commentedon May 31, 2018
Perhaps a different statement of the issue is that invalid or outdated swagger specs are not handled elegantly? I don't think that type of problem should manifest as a NPE.
8 remaining items
jmini commentedon Jul 31, 2018
The issue in Swagger-Parser was fixed, and with PR #696 OpenAPI-Generator was updated to use a version containing the fix.
This issue reported here, should no longer appear with the newest
3.2.0-SNAPSHOTversion.@bmordue, @andreevlex, can you check it?
bmordue commentedon Jul 31, 2018
@jmini I'm happy to close, thanks
ava57r commentedon Jul 31, 2018
@jmini Thank you. I haven't checked anything yet.
I'll check it tomorrow.
ava57r commentedon Aug 2, 2018
still can't generate Yandex api.
wrote to the developers Yandex.
jmini commentedon Aug 20, 2018
@andreevlex : my guess is that you now have an other issue (and an other stacktrace). Maybe this issue could be closed and a new one could be created with the issue that appears with the
3.2.1release.