Replies: 3 comments 4 replies
-
|
There is probably no strict reason for So I'd be ok in removing As to validation, I don't think there is any good hooks to add this in: this should not require sub-classing of serializers. But there is also the problem of requiring more metadata as context that may not be easy to solve. Overall I think currently validation is best run separate from deserialization; but I'd be open to adding additional support for in-flow extension points. But I probably won't have time driving such efforts; can and will help as usual. |
Beta Was this translation helpful? Give feedback.
-
|
hey all, i needed this today and here is my attempt: steve-community/ocpp-jaxb#25 i was coming from the same baeldung article, and was able to create validation for serialization with a similar approach. therefore, the |
Beta Was this translation helpful? Give feedback.
-
|
In my experience migrating to jackson3, I found a few edge cases in de-serialization to point out:
Looking at your serialization implementation I see that jackson-databind chose to implement a DelegatingDeserializer but not a |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
I am attempting to enforce JSR-380 validation after deserialization and before serialization without having a custom deserializer and serializer for each class. This is achievable before deserialization as shown in this baeldung article. Taking the same approach with serialization does not work because BeanSerializer.serialize is final.
A few questions:
Below is an example project showing this with two unit tests. Deserialization passes and serialization fails because serialization is not configured for validation.
sample project
Beta Was this translation helpful? Give feedback.
All reactions