Skip to content
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

Per-type config override "JsonFormat.Shape.OBJECT" for Map.Entry not working #1895

Closed
mcortella opened this issue Jan 16, 2018 · 2 comments
Closed
Milestone

Comments

@mcortella
Copy link

mcortella commented Jan 16, 2018

Hi, after updating from a 2.0.x version of jackson to 2.9.2 we faced an issue with the serialization of Map.Entity as reported also here #565. One of the proposed solution to have a backward-compatibility to versions prior to 2.5, as a default, is this one:

ObjectMapper mapper = new ObjectMapper(); mapper.configOverride(Map.Entry.class).setFormat(JsonFormat.Value.forShape(JsonFormat.Shape.OBJECT));

But unluckly is not working. Is there a way to fix that or have a similar solution without using annotations?

Thanks.

@mcortella mcortella changed the title Per-type config override "JsonFormat.Shape.OBJECT" not working Per-type config override "JsonFormat.Shape.OBJECT" for Map.Entry not working Jan 16, 2018
@cowtowncoder
Copy link
Member

Hmmmh. #1419 states it does not work for property. But it should work as type override.

@cowtowncoder cowtowncoder added 2.9 and removed ACTIVE labels Jan 16, 2018
@cowtowncoder
Copy link
Member

Ok, with added test I can see configOverride does not, indeed, work: only class annotation (direct or mix-in does). So there's a bug to fix.

@cowtowncoder cowtowncoder added this to the 2.9.4 milestone Jan 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants