-
Notifications
You must be signed in to change notification settings - Fork 71
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
Register Jackson modules, based on global user configuration #704
Comments
(Not up for grabs yet. Need to discuss it first.) |
Another approach would be to simply allow to list the classes that should be registered. Grab the list, instanciate via reflection, crash on wrong input. This would be future proof and allows to register custom modules etc without having to go down the route of defining what well known means. |
That's what I meant with the follow-up proposal (under the vertical divider). |
I agree with @nipafx. The defensive approach with |
I'm sorry, I have absolutely no idea why I didn't see this. I agree that |
I like the idea of having the |
One way to address #624 (JSON argument source fails with
LocalDate
property deserialization) is for Pioneer to globally register Jackson modules based on a configuration option set by the user. The option is necessary because there are different possible behaviors (e.g. only register well-known modules vs registering all modules) that don't work equally well across all test suites.After conversations in #624 and #629, I propose the following:
junitpioneer.jackson.modules.registration
none
,well_known
,all
The current behavior is
none
and since switching to any other would be a backwards-incompatible change, I recommend to havenone
as default for now. Overall, I thinkwell_known
is the better default, though, so I propose we make that the default in 3.0 and already document that now.If this proposal is accepted and implemented, a follow-up issue could add a more sophisticated option:
junitpioneer.jackson.modules.registration
, add the new valuelist
junitpioneer.jackson.modules.list
...modules.registration
is set tolist
, the value of...modules.list
is interpreted as a comma-separated list of Jackson modules that will be registered...modules.list
is set and...modules.registration
is set to any other value thanlist
, there should be a warning or even errorI only added this additional proposal here to foreshadow a more detailed option in case the three values
none
,well_known
,all
aren't flexible enough, so for this issue we can focus on implementing those three.The text was updated successfully, but these errors were encountered: