How to deserialize from json to a class without using a custom deserializer.
This is our class:
And we have these json from a response as a String:
In order to convert it to Ourclass we can do it like this:
Note: This is possible because we are using “normal” types. I have checked that if Money from org.javamoney.moneta.Money is used does not work and it returns this error:
“com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of org.javamoney.moneta.Money (no Creators, like default constructor, exist)”