[jackson-user] Custom deserializer recursively calls `deserialize` method

2019-06-07 Thread 遗迹
The same problem. I'm using kotlin too. The subclasses has inherit @Deserializer annotation again. So the ObjectMapper fall in an infinite-loop. -- You received this message because you are subscribed to the Google Groups "jackson-user" group. To unsubscribe from this group and stop receiving

[jackson-user] Custom deserializer recursively calls `deserialize` method

2019-05-22 Thread 'ilker cam' via jackson-user
Hi, I have a property which can be an integer or an object without any explicit `type` property. I tried to use JsonDeserialize annotation and provide a custom deserializer; data class Report(val measures: List) @JsonDeserialize(using=IntOrMeasureDeserializer::class) sealed class IntOrMeasure

Re: [jackson-user] Custom Deserializer

2018-04-09 Thread sean
That worked. Thanks for the suggestion Tatu. On Monday, April 9, 2018 at 6:47:15 PM UTC-4, Tatu Saloranta wrote: > > Do you think `@JsonAnySetter` would work here, attached to Map? It > would get all values that do not map to existing regular properties? > It wouldn't do anything for

Re: [jackson-user] Custom Deserializer

2018-04-09 Thread Tatu Saloranta
Do you think `@JsonAnySetter` would work here, attached to Map? It would get all values that do not map to existing regular properties? It wouldn't do anything for underscores but would allow easy collection. Or, if you want to strip underscore, you could specify method instead @JsonAnySetter

[jackson-user] Custom Deserializer

2018-04-09 Thread sean
Hello, I'm trying to figure out the best way to implement a deserializer for the following setup: class Model { private String prop1; private String prop2; Map userDefined; } json: { "prop1": "prop one", "prop2": "prop two", "_prop3": "prop three", "_prop4":

[jackson-user] Custom deserializer for Optinal with defined values for Optional.empty()

2018-03-19 Thread cap5lut
Hello, I have a problem with a deserializer I am working on. At the deserializer I want to register values, which indicate that the resulting Optional should be empty. But if the value in the JSON string is null, the Optional will be null as well, else it works as expected. Here is the code