Let one pass an external ObjectMapper to JacksonRuntime instance#40
Let one pass an external ObjectMapper to JacksonRuntime instance#40iconara merged 1 commit intoburtcorp:masterfrom gatling:master
Conversation
bittrance
left a comment
There was a problem hiding this comment.
This seems a reasonable change; I've wanted to pass an ObjectMapper myself at least once. However, I don't understand why this PR also changes the .gitignore and pom.xml. Are those changes related in any way? If so, the PR description should mention why. Otherwise, they should go in separate PR(s).
Also, it would be good for posterity (read Google Search) if the PR description mentioned why you may want to pass in your own ObjectMapper (my own reason was date formats, IIRC).
Motivation: JacksonRuntime currently creates it own internal ObjectMapper instance. This ObjectMapper is used for parsing JSON String an emitting JsonLiteral instances. Jackson provides lots of features, see https://static.javadoc.io/com.fasterxml.jackson.core/jackson-core/2.9.9/com/fasterxml/jackson/core/JsonParser.Feature.html. Users might want to provide their own ObjectMapper instance configured for their needs (allowing numeric leading zeros, custom date formats, etc) or simply because they already have an instance and there's no reason the create a second one. Modification: Add a new constructor. Result: Users can provide their own ObjectMapper instance.
Done, PR and commit description updated
Done, PR spit into 3 Cheers! |
|
I'm going to dust off the release machinery and see if I can get a release deployed today. |
|
@iconara Do you need any help with that? It's super weird that the commit history only has the prepare commit and not the perform one. |
|
I've gotten 0.3.0 released now. I can't say I know what I'm doing when releasing Maven artefacts, but it seems to have worked. It hasn't appeared on Maven central yet, but the I run |
|
All good, artifacts are sync'ed on central: https://repo1.maven.org/maven2/io/burt/jmespath-core/0.3.0/ Thanks a lot! |
|
Thank you too! |
Motivation:
JacksonRuntime currently creates it own internal ObjectMapper instance.
This ObjectMapper is used for parsing JSON String an emitting JsonLiteral instances.
Jackson provides lots of features, see https://static.javadoc.io/com.fasterxml.jackson.core/jackson-core/2.9.9/com/fasterxml/jackson/core/JsonParser.Feature.html.
Users might want to provide their own ObjectMapper instance configured for their needs (allowing numeric leading zeros, custom date formats, etc) or simply because they already have an instance and there's no reason the create a second one.
Modification:
Add a new constructor.
Result:
Users can provide their own ObjectMapper instance.