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 if YAML contains external ref #379

Open
thisiskarthikj opened this issue Dec 12, 2019 · 3 comments
Open

NullPointerException if YAML contains external ref #379

thisiskarthikj opened this issue Dec 12, 2019 · 3 comments
Labels

Comments

@thisiskarthikj
Copy link

Swagger2Markup version: swagger2markup-cli-1.3.3.jar

Problem description:

I have the following YAML which has a path referencing an external (working) YAML and the corresponding object is specified with YAML anchors. When I verify the swagger document in the UI, I do see the api definition (retrieved from the external server) but when I run the following command to generate the adoc, I get NullPointerException

info:
  title: abc REST API specification
  description: >-
    test
  version: 4.0
schemes:
  - http
paths:
  /catalog/v1/config:
      $ref: "http://abc:31820/static/abc-rest-api.yaml#/paths/~1config"

Output:

karthiks-mbp:mdc karthikjayaraman$ java -jar swagger2markup-cli-1.3.3.jar convert --config=./swagger2markup.config -i ~/Desktop/test-min.yaml -f test
12:11:41.796 [main] INFO io.swagger.parser.Swagger20Parser - reading from /Users/karthikjayaraman/Desktop/test-min.yaml
12:11:42.155 [main] DEBUG i.g.s.i.document.PathsDocument - Generate examples is disabled.
12:11:42.155 [main] DEBUG i.g.s.i.document.PathsDocument - Create separated operation files is disabled.
12:11:42.156 [main] DEBUG i.g.s.i.document.DefinitionsDocument - Create separated definition files is disabled.
12:11:42.322 [main] INFO i.g.s.m.b.i.asciidoc.AsciiDocBuilder - Markup document written to: /Users/karthikjayaraman/mdc/test.adoc
Exception in thread "main" java.lang.NullPointerException
at io.github.swagger2markup.internal.component.ResponseComponent.lambda$apply$1(ResponseComponent.java:123)
at java.util.TreeMap.forEach(TreeMap.java:1005)
at io.github.swagger2markup.internal.component.ResponseComponent.apply(ResponseComponent.java:87)
at io.github.swagger2markup.internal.component.PathOperationComponent.buildResponsesSection(PathOperationComponent.java:227)
at io.github.swagger2markup.internal.component.PathOperationComponent.apply(PathOperationComponent.java:106)
at io.github.swagger2markup.internal.document.PathsDocument.applyPathOperationComponent(PathsDocument.java:223)
at io.github.swagger2markup.internal.document.PathsDocument.buildOperation(PathsDocument.java:207)
at io.github.swagger2markup.internal.document.PathsDocument.lambda$buildsPathsSection$0(PathsDocument.java:119)
at java.util.ArrayList.forEach(ArrayList.java:1255)
at io.github.swagger2markup.internal.document.PathsDocument.buildsPathsSection(PathsDocument.java:119)
at io.github.swagger2markup.internal.document.PathsDocument.apply(PathsDocument.java:103)
at io.github.swagger2markup.Swagger2MarkupConverter.applyPathsDocument(Swagger2MarkupConverter.java:197)
at io.github.swagger2markup.Swagger2MarkupConverter.toFile(Swagger2MarkupConverter.java:240)
at io.github.swagger2markup.cli.Application.run(Application.java:84)
at io.github.swagger2markup.cli.Application.main(Application.java:61)

I tried adding the swagger2markup.interDocumentCrossReferencesEnabled=true property to the config file and still ended up with NPE. Any help appreciated !

@thisiskarthikj
Copy link
Author

Bump !

@RobWin
Copy link
Member

RobWin commented Jan 2, 2020

Sry I'm too busy at the moment with Resilience4j.
Did you try to debug it?

@RobWin
Copy link
Member

RobWin commented Jun 16, 2020

I guess it's a problem of the SwaggerParser

@RobWin RobWin added the wontfix label Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants