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 limits are enforced again JSON documents.
- XML parser limits are enforced against JSONx documents.
| JSON parser limit | JSON default value | JSON maximum value | XML parser limit | XML default value | XML maximum value |
|---|---|---|---|---|---|
| Maximum document size | 4194304 bytes |
5368709121 bytes |
XML bytes scanned | 4194304 bytes |
|
| Maximum nesting depth | 64 levels |
256 levels |
XML element depth | 512 levels |
|
| Maximum label string length | 256 bytes |
8192 bytes |
XML node size | 33554432 bytes |
4294967295 bytes |
| Maximum value string length | 8192 bytes |
5368709121 bytes |
XML node size | 33554432 bytes |
4294967295 bytes |
| Maximum number length | 128 bytes |
256 bytes |
XML node size | 33554432 bytes |
4294967295 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.