-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
CsvMapper.typedSchemaForWithView()
with DEFAULT_VIEW_INCLUSION
#308
Comments
jackson-dataformats-text/csv/src/main/java/com/fasterxml/jackson/dataformat/csv/CsvMapper.java Lines 499 to 501 in df08c1e
This should maybe be changed to if (!(getSerializationConfig().isEnabled(MapperFeature.DEFAULT_VIEW_INCLUSION) || ViewMatcher.construct(views).isVisibleForView(view))) {
continue;
} but I didn't test it and so I do not know, if this would effect other cases. |
Actually, it boils down to one of these three expressions !ViewMatcher.construct(views).isVisibleForView(view) && !(views == null && this.getSerializationConfig().isEnabled(MapperFeature.DEFAULT_VIEW_INCLUSION))
!ViewMatcher.construct(views).isVisibleForView(view) && (views != null || !this.getSerializationConfig().isEnabled(MapperFeature.DEFAULT_VIEW_INCLUSION))
!(ViewMatcher.construct(views).isVisibleForView(view) || (views == null && this.getSerializationConfig().isEnabled(MapperFeature.DEFAULT_VIEW_INCLUSION))) meaning, serialize this property when any of these two conditions is true
|
Thank you very much for reporting this & submitting a patch. I hope to check it out over the weekend, get it merged. |
CsvMapper.typedSchemaForWithView()
with DEFAULT_VIEW_INCLUSION
Thank you again for reporting, fixing this @mrpiggi! It will be in 2.13.2 once I get that released (probably later this month). |
Using
CsvMapper.typedSchemaForWithView(Class<?> pojoType, Class<?> view)
for a pojoType—which does not define a default view with@JsonView
as type annotation—ignores fields without an@JsonView
annotation during the creation of the schema. This behavior differs in comparison toJsonMapper
. See the given test case.The text was updated successfully, but these errors were encountered: