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

Annotation for DeserializationConfig.Feature ACCEPT_SINGLE_VALUE_AS_ARRAY (via @JsonFormat(with=Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) #43

Closed
Polve opened this issue Sep 11, 2014 · 3 comments
Milestone

Comments

@Polve
Copy link

Polve commented Sep 11, 2014

I would like to configure that property per-class, using annotations.

@cowtowncoder
Copy link
Member

One possible way to implement this: add a new property or properties for @JsonFormat -- seems like it'd be the relevant existing annotation to use.
I think this should also cover the related SerializationFeature.WRITE_SINGLE_ELEM_ARRAYS_UNWRAPPED as well.

@cowtowncoder cowtowncoder changed the title Annotation for DeserializationConfig.Feature ACCEPT_SINGLE_VALUE_AS_ARRAY Annotation for DeserializationConfig.Feature ACCEPT_SINGLE_VALUE_AS_ARRAY (via @JsonFormat(with=Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) Jun 18, 2015
@cowtowncoder
Copy link
Member

Note: will be implemented as somewhat general-purpose facility, extension to @JsonFormat with new properties with and without, and enumeration JsonFormat.Feature that defines possible features to enable/disable. The reason latter is needed (instead of referring to SerializationFeature, DeserializationFeature) is that annotation package does not (and can not) depend on jackson-databind, so there will be bit of redundancy. On plus side this does allow carefully selecting kinds of features that can and should be supported, as well as possibly adding things for which there is no databind-level feature.

@cowtowncoder cowtowncoder added this to the 2.6.0-rc3 milestone Jun 18, 2015
@fabiolados
Copy link

This was a nice addition. I encountered a possible problem: #67

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

3 participants