FasterXML / FasterXML/jackson-module-scala

Add option to use ListMap instead Map and preserve properties order for untyped deserialization

Aperta
#783 17 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Scala
Stelle
506
Fork
138
Merge medio
3h 6m
PR unite (30g)
48

Descrizione

Hi, recently i hit an use case where:
* it shoud rely on type Any to parse an arbitrary deep json as Map[String,Any]
* but preserving order of keys

Afaiu the code for untyped json deserialization [uses Map in a fixed way](https://github.com/FasterXML/jackson-module-scala/blob/1d8afbed904af98badeb6db323c04d714c5d0684/src/main/scala/tools/jackson/module/scala/deser/UntypedObjectDeserializerModule.scala#L26).

To change it for preserve order i had to implement a 100 loc class with a new untyped deserializar and rebuild the scala module: https://gist.github.com/jneira-stratio/f0566c79b0284b05bb421d104bd318d7

My first question is if there is another, simpler way to get it working.
Otoh would make sense to add a configuration option to being able to get that behaviour?
It seems to me that it is a relative common use case.

Thanks in advance!

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.