Best practices
In this section, we outline best practices for effectively using
json.Serializer to enhance performance and avoid common pitfalls.
The following best practices can help ensure effective use of
json.Serializer:
- Disable
allowImplicitConversionin production to avoid silent errors. - Use native JSON booleans and numbers rather than quoted values (for example, use
trueinstead of"true"). - Favor strict formats for
DATE(YYYY-MM-DD) andDATETIME(YYYY-MM-DD HH:MM:SS). - Use
json_null="null"when handlingNULLvalues. For more information about managing null with thejson_nullattribute, go to NULLs and empty structures.