You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the solution you'd like
Currently, the functionality of Sequence is limited compared to Collection and others.
For example, @JsonDeserialize(contentUsing = ... is not available.
classSequenceTests {
val mapper = jacksonObjectMapper()
classContentDeser : StdDeserializer<String>(String::class.java) {
overridefundeserialize(p:JsonParser, ctxt:DeserializationContext): String= p.text +"-deser"
}
data classListWrapper(@JsonDeserialize(contentUsing =ContentDeser::class) valvalue:List<String>)
@Test
funlistContentDeser() {
val result = mapper.readValue<ListWrapper>("""{"value":["foo"]}""")
assertEquals("foo-deser", result.value.single())
}
data classSequenceWrapper(@JsonDeserialize(contentUsing =ContentDeser::class) valvalue:Sequence<String>)
@Test
funsequenceContentDeser() {
val result = mapper.readValue<SequenceWrapper>("""{"value":["foo"]}""")
assertEquals("foo-deser", result.value.single()) // -> fails
}
}
There are several other features that are not available in principle.
These features should be available.
The text was updated successfully, but these errors were encountered:
Describe the solution you'd like
Currently, the functionality of
Sequence
is limited compared toCollection
and others.For example,
@JsonDeserialize(contentUsing = ...
is not available.There are several other features that are not available in principle.
These features should be available.
The text was updated successfully, but these errors were encountered: