arangodb / java-velocypack-module-scala

Apache License 2.0
6 stars 3 forks source link

MapLike serialized incorrectly #15

Closed wajda closed 3 years ago

wajda commented 3 years ago

Maps obtained by calling Map.mapValues(...) or Map.filterKeys(...) etc serialized as plain objects ({f: {}} and {p: {}} respectively)

wajda commented 3 years ago

I'm working on the fix, will send a PR shortly

wajda commented 3 years ago

I'm going to fix it by registering a serializer for more concrete Map impl classes, simply because it's how it's done and it's easy. But generally speaking it's not a future proof solution. A concrete serializer should be looked up recursively starting from this.getClass and moving up the object hierarchy. Yet not sure if it can be done on top of the existing velocypack code base without making to much changes.

rashtao commented 3 years ago

Hi @wajda , thanks for reporting and contributing.

From what I can see, there are many cases uncovered by this library, either related to different Scala versions or specific Scala types, which require a lot of effort to implement, maintain and further develop (eg. with regards to Scala 3).

On the other side, jackson-dataformat-velocypack reached version 1.0.0 and can be configured with Jackson Scala language module which comes with full support for Scala 2.11 and 2.12 and 2.13 (and plans to support Scala 3).

Therefore I would like to deprecate this library and invite you to migrate your projects to jackson-dataformat-velocypack.

wajda commented 3 years ago

Thanks, I will take a look. But even being deprecated this library still does its job great for majority of use cases, so if you don't mind it would be great to finish this fix especially having the code prepared already. Thank you!