auth0 / auth0-java

Java client library for the Auth0 platform
https://auth0.com
MIT License
287 stars 131 forks source link

Add findAndRegisterModules() to ObjectMapper #442

Closed larsf96 closed 2 years ago

larsf96 commented 2 years ago

Changes

After initialization of CustomRequest, I added the call this.mapper.findAndRegisterModules(); which will let the ObjectMapper register all the modules that are configured (i.e. JavaTimeModule for Java 8 Date classes) This fixes #440

References

440

Testing

As this is only one line of code that has quite 0 logic, I didn't add tests. If required, a possible test could be to verify that the modules are getting loaded

Checklist

poovamraj commented 2 years ago

@larsf96 I am wondering whether this could be a breaking change that registers all the modules that a project has having unexpected side effects.

Probably an API should be exposed to use registerModules instead.

larsf96 commented 2 years ago

@poovamraj I added an API on Request level that can be executed to register modules for each call, would that be okay?