All,
Can anyone see the error of my ways?
I need custom deserialization, from JSON, to work in DW. I followed some
how tos but it isn't working. The upshot is i don't have available a
default, no-arg constructor. Instead, I have a factory method.
I created a mixin:
public abstract class PatientMixin {
@JsonCreator
public ForecastPatient createForecastForecastPatient() {
return ForecastFactory.eINSTANCE.createForecastPatient();
}
}
In my DW Application.run(...) I did this:
<code before>
environment.getObjectMapper().addMixIn(ForecastPatient.class,
PatientMixin.class);
<code after>
I thought DW would find my Mixin and call the factory. Instead I am
getting an error
Can not construct instance of forecast.ForecastPatient, problem: abstract
types either need to be mapped to concrete types, have custom deserializer,
or be instantiated with additional type information
I would have thought I had things mapped properly but apparently not. Also,
the examples I am reading appear to out of date.
Thanks in advance
--
You received this message because you are subscribed to the Google Groups
"dropwizard-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.