-
Notifications
You must be signed in to change notification settings - Fork 15
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
Using JsonParser.Feature.* ? #29
Comments
@oschrenk It's not currently possible off the shelf, but it also wouldn't be terribly difficult. I think this is something we'll want to add at some point, so if you have ideas or would like to discuss an implementation, that would be excellent. |
It is actually possible to do this, if you explicitly extend the necessary traits: object CustomJacksonParser extends WithJacksonMapper with JacksonParser {
mapper.configure(SomeFeatures.SOME_FEATURE, true)
} Then you just use this object instead of the default CustomJacksonParser.decode[YourType](input) Although this does feel quite hacky. |
Apparently my above code only works for deserializer features, because circe creates a separate JsonFactory specifically to do parsing and does not use the mapper's own factory to do the parsing (just curious, what is the reason for this?), and this separate JsonFactory does not use features enabled in the original mapper. I see no other way around right now except for reflection. |
@netvl I'm not sure why there's a separate |
Is there currently a way to enable features such as JsonParser.Feature.ALLOW_TRAILING_COMMA (this is how you know I have to deal with malformed json)?
The text was updated successfully, but these errors were encountered: