-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 in ModelResolver #3311
Comments
Can you share the class/method causing the issue? |
At least this is my prime suspect.. Might be that links field as well; It has a polymorphic child, but that is not exactly uncommon in the Jackson world: Links is a bean that has a @JsonValue method that returns a map, where the values are a superclass with two implementations. |
A possible co-culprit might be your shared bean using 1.5/x version (swagger/OpenAPI 2.0) of annotations, swagger-core 2.x supports a different set of annotations. You would need to update the bean to use the new set. Additionally |
We can rule out both those. The sister project I talked about uses that @JsonSerialize.as statement in all beans and somehow works (is that a fluke then, perhaps?), in addition I've tried porting all the beans over to the new annotation style without luck; It fails even without any openAPI annotations.. |
playing a bit around for some reason this seemed to happen in scenarios with both |
That's awesome! Lightning fast :-) Thank you so much. I suppose I have a great deal to do very soon in order to port all the annotations over to v3.. |
Hello, I'm stuck at Swagger API 2.0 because upgrading the config to generate openapi v.3.0 (running swagger-core 2.0.9) results in the following exception when running:
[ERROR] Error resolving API specification java.lang.NullPointerException at io.swagger.v3.core.jackson.ModelResolver.resolve (ModelResolver.java:320) at io.swagger.v3.core.converter.ModelConverterContextImpl.resolve (ModelConverterContextImpl.java:90) at io.swagger.v3.core.jackson.ModelResolver.lambda$resolve$1 (ModelResolver.java:614) at io.swagger.v3.core.jackson.ModelResolver.resolve (ModelResolver.java:277) at io.swagger.v3.core.converter.ModelConverterContextImpl.resolve (ModelConverterContextImpl.java:90) at io.swagger.v3.core.jackson.ModelResolver.resolve (ModelResolver.java:622) at io.swagger.v3.core.converter.ModelConverterContextImpl.resolve (ModelConverterContextImpl.java:90) at io.swagger.v3.core.jackson.ModelResolver.resolve (ModelResolver.java:395) at io.swagger.v3.core.converter.ModelConverterContextImpl.resolve (ModelConverterContextImpl.java:90) at io.swagger.v3.core.jackson.ModelResolver.resolve (ModelResolver.java:363) at io.swagger.v3.core.converter.ModelConverterContextImpl.resolve (ModelConverterContextImpl.java:90) at io.swagger.v3.core.jackson.ModelResolver.resolve (ModelResolver.java:622) at io.swagger.v3.core.converter.ModelConverterContextImpl.resolve (ModelConverterContextImpl.java:90) at io.swagger.v3.core.converter.ModelConverters.resolveAsResolvedSchema (ModelConverters.java:112) at io.swagger.v3.jaxrs2.Reader.parseMethod (Reader.java:1020) at io.swagger.v3.jaxrs2.Reader.parseMethod (Reader.java:818)
Any ideas what's wrong/any fixes/workarounds? I've gotten quite "creative" using Jackson in this project, and in the sister project it works fine, so I suspect this is related to that rather creative bean that references a list of itself alongside having a @JsonUnwrapped member?
The text was updated successfully, but these errors were encountered: