-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Jackson2ExecutionContextStringSerializer: customization #3765
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
Mixins are the expected way to handle classes you do not have the ability to modify with Jackson. Is there a reason you cannot use one for UUID? That being said, if we can confirm UUID is not a "gadget class", it also feels like one that would be reasonable to just add to our list. |
@mminella Can you please show me how to configure the I do not believe it's currently possible. I could configure my own |
I had the same issue than @fprochazka : maybe we're both missing something ... but as already stated if we create our own ObjectMapper we loose the TrustedTypeIdResolver entirely ... Also I'm using spring-boot and used to having everything working out of the box with sensible defaults but still being configurable ... now to accept UUID (and java.sql.Timestamp in my case) I have to define a BatchConfigurer, configure a JobLauncher, JobRepository, JobExplorer (hoping I have everything setup correctly) ... A property with a list of additional trusted types would be really great ! |
When trying to compare how other projects from the portfolio deal with this requirement, I see that SI provides an utility method to create an We will discuss this internally and see the best way to address it. |
…gSerializer This commit adds the ability to specify additional trusted classes without having to provide a custom object mapper. Issue spring-projects#3765
…gSerializer This commit adds the ability to specify additional trusted classes without having to provide a custom object mapper. Issue spring-projects#3765
I opened #3787 for this. It adds the ability to extend the base set of trusted classes (by passing the additional ones at construction time of the @fprochazka @snussbaumer Looking forward to your feedback on this. |
Thanks, it looks quite good to me ! I know this is spring boot territory, but it would be perfect if the interface This would looks like this for people wanting to customize the serializer
|
…gSerializer This commit adds the ability to specify additional trusted classes without having to provide a custom object mapper. Issue #3765
Thank you for your feedback! #3787 is now merged.
The serializer is an implementation detail of the |
Hi, I am getting following error. It seems primitive types cannot be serialized.
|
I would like to be able to extend the
TRUSTED_CLASS_NAMES
without having to copy&paste the entireJackson2ExecutionContextStringSerializer
.I can see that you had to fix a security vuln in #3732, but it broke (de)serialization in a lot of apps. I have no problem adding the annotations to my classes, but I have no idea how to allow
java.util.UUID
.I suggest that you introduce a mechanism, that would allow me to extend the list of trusted classes in case there is a JDK/library class I cannot modify.
Also it's really hard to override the serializer and I had to extend a bunch of configuration and bean factory classes to accomplish it.
The text was updated successfully, but these errors were encountered: