removes Jackson from platform and uses Gson instead.
Removes any Json-related code from these modules:
Nomad
Sanskrit
iNet
Struct
DC model
DC API
DC Server API
No change in the communication format, test ran against a previous platform kit using Jackson.
Some important notes:
Gson works completely differently than Jackson. It is field-based and reflection-based
Gson is really SIMPLE. It does its best to prevent user from serialising when it knows it won't be able to deserialise.
As a consequence, Gson does not support polymorphism
Gson does also not support class loading and mapping Class objects
Gson also does not support raw / wildcard types since it cannot deserialise
Gson has no mixin support
Gson factory order is important
Gson is strongly types and makes a string difference between declared types (used to select type adapters) and runtime types
All these missing features had to be added. So a lot of code was written to cope with missing Gson features, and also allow class loading and unknown type deserialisation, through a mechanism where we only specify the type names we allow for security reasons.
Gson is really easy to use. The *Module classes in different modules are stripped down compared to Jackson ones and writing custom type adapters is easier too.
This PR:
No change in the communication format, test ran against a previous platform kit using Jackson.
Some important notes:
Class
objectsAll these missing features had to be added. So a lot of code was written to cope with missing Gson features, and also allow class loading and unknown type deserialisation, through a mechanism where we only specify the type names we allow for security reasons.
Gson is really easy to use. The
*Module
classes in different modules are stripped down compared to Jackson ones and writing custom type adapters is easier too.