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 in io.swagger.v3.core.jackson.ModelResolver.getIgnoredProperties #3673

Closed
tangjwtj opened this issue Jul 30, 2020 · 1 comment
Assignees
Milestone

Comments

@tangjwtj
Copy link

tangjwtj commented Jul 30, 2020

io.swagger.v3.core.jackson.ModelResolver.getIgnoredProperties does not check jackson return value.
In getIgnoredProperties method, assume jackson will not return null.

Set<String> ignored = introspector.findPropertyIgnorals(beanDescription.getClassInfo()).findIgnoredForSerialization();

But, In Jackson's implementation class AnnotationIntrospectorPair:

public Value findPropertyIgnorals(Annotated a) { Value v2 = this._secondary.findPropertyIgnorals(a); Value v1 = this._primary.findPropertyIgnorals(a); return v2 == null ? v1 : v2.withOverrides(v1); }

v1/v2 may be null.

The exception:
java.lang.NullPointerException: null
at io.swagger.v3.core.jackson.ModelResolver.getIgnoredProperties(ModelResolver.java:2002)
at io.swagger.v3.core.jackson.ModelResolver.resolve(ModelResolver.java:536)
at org.springdoc.core.converters.AdditionalModelsConverter.resolve(AdditionalModelsConverter.java:100)
at org.springdoc.core.converters.PropertyCustomizingConverter.resolve(PropertyCustomizingConverter.java:56)
at org.springdoc.core.converters.FileSupportConverter.resolve(FileSupportConverter.java:50)
at org.springdoc.core.converters.ResponseSupportConverter.resolve(ResponseSupportConverter.java:62)
at org.springdoc.core.converters.SchemaPropertyDeprecatingConverter.resolve(SchemaPropertyDeprecatingConverter.java:55)
at org.springdoc.core.converters.PolymorphicModelConverter.resolve(PolymorphicModelConverter.java:46)
at io.swagger.v3.core.converter.ModelConverterContextImpl.resolve(ModelConverterContextImpl.java:91)
at io.swagger.v3.core.converter.ModelConverters.resolveAsResolvedSchema(ModelConverters.java:117)

@frantuma frantuma self-assigned this Aug 3, 2020
@frantuma frantuma added this to the M6 milestone Aug 3, 2020
frantuma added a commit that referenced this issue Aug 3, 2020
refs #3673 - Null check getIgnoredProperties
@frantuma
Copy link
Member

frantuma commented Aug 3, 2020

Thanks for reporting this, null check added in #3674

@frantuma frantuma closed this as completed Aug 3, 2020
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

2 participants