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.
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. The 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.
- 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
- 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