Product SiteDocumentation Site

10.3.3. Influence of other serialization parameters upon the JSON output method

10.3.3.1. JSON output method: the indent parameter

Like for the XML output method, the indent parameter controls if the serializer is allowed to add extra whitespaces to make the output easier to read. If the indent parameter has the value "yes", the serializer may output additional whitespaces characters outside of JSON literals. If the indent parameter has the value "no", the serializer may not output any whitespaces outside of JSON literals.
If the indent parameter is set to yes, the algorithm for adding whitespaces is allowed to add them at the following places, and only at these places:
  • Between an object-opening curly brace and the first key.
  • On either side of a key-value-separating colon.
  • Before and after pair-separating commas in an object.
  • Between the value of the last pair of an object and the object-closing curly brace.
  • Between an array-opening square bracket and the first member.
  • Before and after value-separating commas in an array.
  • Between the last member of an array and the array-closing square bracket.
  • Between two objects or arrays if multiple JSON items are serialized.
In particular, no whitespaces may be added inside JSON literals (strings, numbers, booleans, nulls).
If the indent parameter is set to no, no whitespace may be output to any of the places mentioned above.