Write plain JSON? Standard JSON without metadata for deserialization

If false, the default, serialize to support deserialization:

  • Write metadata, including the types of the serialized objects so they can be deserialized to their original form using JsonDeserializer.
  • Use references when an object has already been serialized so to not duplicate it.
  • Support cycles in references.
  • Preserve the Nit Char and Byte types as special objects.
  • The generated JSON is standard and can be read by non-Nit programs. However, some Nit types are not represented by the simplest possible JSON representation. With the added metadata, it can be complex to read.

If true, serialize for other programs:

  • Nit objects are serialized to pure and standard JSON so they can be easily read by non-Nit programs and humans.
  • Nit objects are serialized for every references, so they can be duplicated. It is easier to read but it creates a larger output.
  • Does not support cycles, will replace the problematic references by null.
  • Does not serialize the metadata needed to deserialize the objects back to regular Nit objects.
  • Keys of Nit HashMap are converted to their string representation using to_s.

Property definitions

json $ JsonSerializer :: plain_json
	# Write plain JSON? Standard JSON without metadata for deserialization
	#
	# If `false`, the default, serialize to support deserialization:
	#
	# * Write metadata, including the types of the serialized objects so they can
	#   be deserialized to their original form using `JsonDeserializer`.
	# * Use references when an object has already been serialized so to not duplicate it.
	# * Support cycles in references.
	# * Preserve the Nit `Char` and `Byte` types as special objects.
	# * The generated JSON is standard and can be read by non-Nit programs.
	#   However, some Nit types are not represented by the simplest possible JSON representation.
	#   With the added metadata, it can be complex to read.
	#
	# If `true`, serialize for other programs:
	#
	# * Nit objects are serialized to pure and standard JSON so they can
	#   be easily read by non-Nit programs and humans.
	# * Nit objects are serialized for every references, so they can be duplicated.
	#   It is easier to read but it creates a larger output.
	# * Does not support cycles, will replace the problematic references by `null`.
	# * Does not serialize the metadata needed to deserialize the objects
	#   back to regular Nit objects.
	# * Keys of Nit `HashMap` are converted to their string representation using `to_s`.
	var plain_json = false is writable
lib/json/serialization_write.nit:28,2--51,35