Allow JacksonJsonpMapper user provided ObjectMapper to maintain configuration
The JacksonJsonpMapper has a public constructor that takes in a user provided ObjectMapper to allow customization for serialization and deserialization. The constructor can be misleading since it overrides two configurations to disable pretty print and disregard null values on serialization. As far as I can tell, there is no other way to modify the ObjectMapper configuration other than through the constructor.
The proposal is that these configurations be moved to the default constructor. This allows users with no preference to take the default configuration, but if custom configuration is desired a user can provide the ObjectMapper. A few advantages to this strategy:
- Default constructor still provides desired default configuration
- Provides more flexibility of configuration to the user
- Constructor with parameter ObjectMapper will be less confusing to the users
For context, the change was made in this commit.
💚 CLA has been signed
@swallez would you mind providing feedback to this PR? It appears that you were the author of the constructor constraint in question, see commit.
@elasticmachine ok to test
It is great to have that implemented. Thanks for that. I am wondering if this will be in version 7.17.8 and when it is planned to release?
Thanks Cesar