-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Jackson @JsonView deserialization support for request bodies [SPR-12501] #17106
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
Comments
Sébastien Deleuze commented Hi Ersin Er, Your proposal makes sense but Sébastien |
Sébastien Deleuze commented Good news, starting Jackson 2.5.0 |
Enrique Ruiz (DiSiD) commented It would be great if the JSON data binding process would follow the same process of Validation, Data Binding, and Type Conversion than the one done by HTTP forms. Imho the custom validations, data binding and type conversions would be able to be applied to both JSON messages and HTTP messages. |
Andrew Thorburn commented I would love to see this feature, and I was having a look to see if I could get it working with just a few tweaks and maybe extending the jackson message converters, but no dice - the AbstractJackson2HttpMessageConverter has no idea what annotations are attached to the parameter, so it can't fetch the necessary annotation information - that's held one level up, by AbstractMessageConverterMethodArgumentResolver, but it's not passed into the actual message converter. Is there an easy way of dealing with this, or does it require broader changes to the Spring message conversion? |
Enrique Ruiz (DiSiD) commented Sébastien, do you see this feature useful? Can we collaborate in any way? |
Sébastien Deleuze commented Enrique Ruiz (DiSiD) Do you talk about " |
Mikhail Sokolov commented I wrapped Type into ExtendedType that holds both originalType and additional info - view class. Look at the patch attached. |
Enrique Ruiz (DiSiD) commented Hi Sébastien, I meant "JSON data binding process following the same process of Validation, Data Binding, and Type Conversion than HTTP forms" in spite of to use the Jackson2 data binding, validation and conversion process. By doing that, a web application hasn't to define Type Conversion, Data Binding and Validation processes two times. I think this isn't the right issue to comment about this theme, Sébastien could you point me where to report this improvement? Thanks |
Sébastien Deleuze commented Hi Enrique, could your request be related (at least partially) to #11715? I closed it as won't fix last year, but feel free to add a comment in this issue after reading the discussion. |
Uh oh!
There was an error while loading. Please reload this page.
Ersin Er opened SPR-12501 and commented
#11815 added support for
@JsonView
for response bodies. The same can also be applied to request bodies as Jackson already supports@JsonView
for deserialization.Affects: 4.1.2
Attachments:
Issue Links:
@JsonView
@JsonView
deserialization support for@MessageMapping
payloads@JsonView
to be used on meta-annotations on Rest methods4 votes, 9 watchers
The text was updated successfully, but these errors were encountered: