Creating parse settings
A parse settings specifies the constraints of the input document that a parse action accepts. A document is rejected when a defined value exceeds a specified limit.
About this task
By default, the document type is detected and the parsing is based on the detected document type. Instead of detecting the document type, you can define settings to parse the payload based on document type. The supported document types are binary, XML, JSON, and GraphQL.
Parse settings are used when you configure the following objects.
- A parse processing action
- A parse assembly action
- An API collection
Note: Only assembly actions support the GraphQL document type.
The checks that apply when you create a type-specific parse settings differ. The following list
states the checks that apply for each supported document type.
- Binary
- For a binary large object (BLOB) document, the following checks apply.
- Document size
- XML
- For an XML document, the following checks apply.
- Document size
- Nesting depth
- Width
- Name length
- Value length
- Unique names
- Unique prefixes
- Unique namespaces
- JSON
- For a JSON document, the following checks apply.
- Document size
- Nesting depth
- Width
- Name length
- Value length
- Number length
- Unique names
- Entire document in valid UTF-8 encoding
- GraphQL
- For a GraphQL document, the following checks apply.
- Document size
- Nesting depth
- Width
- Name length
- Value length
The parsing for GraphQL happens in one of the following ways.
- As GraphQL in the body of a POST request
- The GraphQL is in the following format.
{ me { name } } - As a JSON string in the body of a POST request that contains a GraphQL query
- Query variables in the request can be sent as a JSON string in a
variablesquery parameter. When the query contains several named operations, anoperationNamequery parameter is needed to determine which operation to run. The JSON object is in the following format.{ "query": "query MyData ($idVar: Int!) { user (id: $idVar) { name }}", "operationName": "MyData", "variables": {"idVar": 123} }When a GraphQL query is parsed, it is recognized as one of the following types.- Standard introspection
- A query that contains only introspection fields that are part of the GraphQL introspection
system, such as
__schemaand__type. - Custom introspection
- A query that contains introspection fields and one or more nonintrospection fields.
- No introspection
- A query that does not contain introspection fields.
- Through the URL query of a GET request
- The URL is in the following
format.
http://myapi/graphql?query={me{name}}
Procedure
Define common settings.
Define settings specific to XML messages.
Define settings specific to JSON messages.