Using @JsonFormat throws an exception as well.
I think your idea merging the maps would work but creates unwanted API and
intermediate objects.
FYI: I ended up using @JsonSerializer(using =...) (note that as does not
work when interface already implements Map) and implemented a fully custom
On Mon, Mar 18, 2019 at 7:28 PM Jan Bernitt wrote:
>
> Hi,
>
> given this model:
>
> interface A extends Map {
>
> Map getExtensions();
>
> String getX();
>
> void setX(String x);
> }
>
> class Foo extends A { }
> class Bar { }
>
> Filling it with data:
>
> Foo foo = new Foo();
>
Hi,
given this model:
interface A extends Map {
Map getExtensions();
String getX();
void setX(String x);
}
class Foo extends A { }
class Bar { }
Filling it with data:
Foo foo = new Foo();
foo.put("bar", new Bar()); // using it as Map
foo.setX("y");
foo.getExtension().put("ext",