JSON parser limits

JSON parser settings and XML parser settings work together to provide configurable settings for message size, nesting depth, and other limits. JSON parser settings apply to the JSON message. XML parser settings apply only to the converted JSONx.

A JSON document is parsed by both the JSON parser and the XML parser if the request or response type is JSON. Use a different request or response type, such as non-XML, when you do not need JSONx. The following information about XML parser settings is relevant only for messages that are converted to JSONx.

For JSON messages, the JSON parser enforces limits on the JSON document when it processes an incoming JSON payload and generates a JSONx document. As the JSONx is being created, the XML parser enforces limits on the JSONx document. You can specify JSON parser limits or use the system defaults.

The XML manager specifies a JSON Settings configuration to associate JSON parser limits with the XML manager. If no JSON Settings configuration is specified, the system default JSON parser limits are enforced.

The following table lists the JSON parser limits that you can configure and the associated XML parser limits.
Table 1. XML parser limits compared to JSON parser limits
JSON parser limit JSON default value JSON maximum value XML parser limit XML default value XML maximum value
Enforced against the JSON document Enforced against the JSONx document
Maximum Document Size 4,194,304 bytes (4 MB) 5,368,709,121 bytes (5 GB) XML Bytes Scanned 4,194,304 bytes (4 MB)  
Maximum Nesting Depth 64 levels 256 levels XML Element Depth 512 levels  
Maximum Label String Length 256 bytes 8,192 (8 K) bytes XML Node Size 33,554,432 bytes (32 MB) 4,294,967,295 bytes
Maximum Value String Length 8,192 (8 K) bytes 5,368,709,121 bytes (5 GB)
Maximum Number Length 128 bytes 256 bytes
The limits of both the JSON parser and the XML parser are enforced. The more restrictive limits apply. If either the JSON parser limits or the XML parser limits are exceeded, the request fails. An HTTP 500 response code is returned to the client.
Note: 7.6.0The limits that are defined in Parse Settings override the defined limits of both the JSON parser and the XML parser.

The following two examples illustrate what happens when the JSON document is parsed.

This first example illustrates a JSON document that is rejected by the JSON parser. The document exceeds the maximum document size limit. The XML limits are not tested.
  • The maximum document size property of the JSON settings is set to 4,194,304 bytes (4 MB)
  • The XML bytes scanned property of the XML parser is set to 4,194,304 bytes (4 MB)
  • The received payload is 4,194,304 bytes (4 MB) plus 1 byte
This second example illustrates a JSON document that passes the JSON parser but is rejected by the XML parser. The JSON parser accepts the document because it is less than 10,485,760 bytes (10 MB). However, the XML parser rejects the request because the converted JSONx document exceeds 4,194,304 bytes (4 MB).
  • The maximum document size of the JSON settings is set to 10,485,760 bytes (10 MB)
  • The XML bytes scanned property of the XML parser is set to 4,194,304 bytes (4 MB)
  • The received payload is 4,194,304 bytes (4 MB) plus 1 byte