Skip to content

Error java.lang.NullPointerException when generate API for Yandex Disk #177

Closed

Description

@ava57r
Description

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)
Declaration file content or url

https://cloud-api.yandex.net/v1/schema/resources/v1/disk/resources

Steps to reproduce
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

this part of the API is normally generated:
https://cloud-api.yandex.net/v1/schema/resources/v1/disk

Activity

  1. wing328 commented on May 30, 2018

    @wing328
    Member

    I got errors when loading the spec with https://editor.swagger.io. Please address those errors and try again.

  2. added this to the 3.0.0 milestone on May 30, 2018
  3. jmini commented on May 30, 2018

    @jmini
    Member

    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?

  4. ava57r commented on May 30, 2018

    @ava57r
    Author

    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.

  5. jmini commented on May 30, 2018

    @jmini
    Member

    Maybe older version of Swagger-Parser can convert this old spec version to a newer one like swagger: 2.0.

  6. bmordue commented on May 31, 2018

    @bmordue
    Contributor

    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.

  7. modified the milestones: 3.0.0, 3.0.1 on Jun 1, 2018
  8. modified the milestones: 3.0.1, 3.0.2 on Jun 11, 2018
  9. modified the milestones: 3.0.2, 3.0.3 on Jun 18, 2018
  10. modified the milestones: 3.0.3, 3.1.0 on Jun 27, 2018
  11. 8 remaining items

  12. modified the milestones: 3.1.1, 3.1.2 on Jul 18, 2018
  13. modified the milestones: 3.1.2, 3.2.0 on Jul 25, 2018
  14. jmini commented on Jul 31, 2018

    @jmini
    Member

    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-SNAPSHOT version.
    @bmordue, @andreevlex, can you check it?

  15. bmordue commented on Jul 31, 2018

    @bmordue
    Contributor

    @jmini I'm happy to close, thanks

  16. ava57r commented on Jul 31, 2018

    @ava57r
    Author

    @jmini Thank you. I haven't checked anything yet.
    I'll check it tomorrow.

  17. ava57r commented on Aug 2, 2018

    @ava57r
    Author

    still can't generate Yandex api.

    wrote to the developers Yandex.

  18. modified the milestones: 3.2.0, 3.2.1 on Aug 6, 2018
  19. modified the milestones: 3.2.1, 3.2.2 on Aug 14, 2018
  20. jmini commented on Aug 20, 2018

    @jmini
    Member

    @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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions