Custom Type Hint Value

25 views
Skip to first unread message

Ludovic Chane

unread,
Jun 4, 2015, 9:52:18 AM6/4/15
to scala...@googlegroups.com
Hi,
Is there any way to customize the type hint value ?

By default we have :
"_typeHint": "com.my.package.MyClass"

I would like something like :
"_typeHint": "MyClass"

(Json4s allows to do this with the TypeHints trait)

Regards,

Ludovic

rose katherine toomey

unread,
Jun 4, 2015, 11:46:18 AM6/4/15
to scala...@googlegroups.com
Hi Ludovic,

Not at present.  The type hint value is used to resolve the correct grater, which is kept in the Context keyed by class name.  Reducing the type hint to "MyClass" means that "foo.MyClass" and "bar.MyClass" can't both exist.

What problem are you trying to solve?  If you're trying to reduce the size of output, you can customize the type hint key and/or suppress serialization of fields whose values match the default values supplied in the constructor.

Best,
Rose
 

--
You received this message because you are subscribed to the Google Groups "scala-salat" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-salat...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages