Understanding implicit/explicit serialization

Explore the key differences in implicit and explicit JSON serialization and deserialization behaviors between json.Serializer and util.json.

It is important to understand the difference in the behavior of json.serializer and util.JSON, especially in terms of implicit and explicit conversion of JSON to Genero BDL.
  • json.Serializer implements strict, schema-driven conversion.
  • util.json implements permissive, dynamic conversion.

In the following sections, we compare the handling of primitive and complex types, focusing on implicit and explicit conversion comparisons, as well as the management of null values. This includes rules for type casting, failure scenarios, and the impact of options such as allowImplicitConversion.

Additionally, the json.Serializer offers various options to control serialization behavior, which are outlined in several of the following sections; for more details, go to Serializer options.