webMethods Integration Server version: 10.7 and above
What are the supported Request parameters in an OpenAPI Request?
Following are the supported parameters:
- Path Parameters
- Query Parameters
- Header Parameters
- Cookie Parameters
The parameter format depends on the style and the explode attributes defined for the parameter in an OpenAPI document. Complex structures like JSON or XML can also be defined for the above parameters.
Use cases
How to build PATH Parameter for an OpenAPI Request?
Path parameters are serialized in three styles, matrix, simple, and label.
Semantics for the parameter may vary based on the schema type and value defined for the explode attribute in the parameter definition.
Note:
It is highly recommended to percent-encode any special characters in the parameter value.
Pre-Conditions
- The user has an OpenAPI document from the service provider.
- The OpenAPI document must have an API with a path parameter.
Basic Flow
- From the OpenAPI document, identify the API to be invoked.
- If the API defines a path parameter, select the parameter name.
- Check the style and the exploded attributes defined for the parameter.
- Format the parameter as described in the following table:
Style | Explode | Primitive Type | Array Type | Object Type |
---|---|---|---|---|
Matrix | false | ;color=blue | ;color=blue,red,green | ;color=R,100,G,200,B,150 |
true | ;color=blue | ;color=blue;color=red;color=green | ;R=100;G=200;B=150 | |
Label | false | .blue | .blue.red.green | .R.100.G.200.B.150 |
true | .blue | .blue.red.green | .R=100.G=200.B=150 | |
Simple | false | blue | blue,red,green | R,100,G,200,B,150 |
true | Blue | Blue,red,green | R=100,G=200,B=150 |
- Add the formatted parameter to the API request URL.
Example Definition
Example URL
https://editor.swagger.io/api/v3/path/simple/explode-true/available/1,2/idname=string,idvalue=0
How to Build QUERY Parameter for an OpenAPI Request?
Query parameters are serialized in four styles, form, spaceDelimitted, pipeDelimitted, and deepObject.
Semantics for the parameter may vary based on the schema type and the value defined for the explode attribute in the parameter definition.
Note:
It is highly recommended to percent-encode any special character in the parameter value.
Pre-Conditions
- User is provided with an OpenAPI document from the service provider.
- The OpenAPI document has an API with a query parameter.
Basic Flow
- From the OpenAPI document, identify the API to be invoked.
- If the API defines a query parameter, select the parameter name.
- Check the style and the explode attributes defined for the parameter.
- Format the parameters as described in the following table:
Style | Explode | Primitive Type | Array Type | Object Type |
---|---|---|---|---|
form | false | color=blue | color=blue,red,green | color=R,100,G,200,B,150 |
true | color=blue | color=blue&color=red&color=green | ;R=100&G=200&B=150 | |
spaceDelimitted | false | NA | Blue%20red%20Green | R%20100%20G%20200%20B%20150 |
true | NA | NA | NA | |
pipeDelimitted | false | blue | Blue | red |
true | NA | NA | NA | |
deepObject | false | NA | NA | Color[R]=100&Color[G]=200 |
&Color[B]=150 | ||||
- Add the formatted parameter to the API request URL
Example Definition
Example URL
https://editor.swagger.io/api/v3/query/form/explode-true?id=1&idname=string&idvalue=0&idArr=param1&idArr=param2
How to Build HEADER Parameter for an OpenAPI Request?
Header parameters follow the “simple” style format.
Semantics for the parameter may vary based on the schema type and the value defined for the explode attribute in the parameter definition.
Pre-Conditions
- User is provided with an OpenAPI document from the service provider.
- The OpenAPI document has an API with a header parameter.
Basic Flow
- From the OpenAPI document, identify the API to be invoked.
- If the API defines a header parameter, select the parameter name.
- Check the style and the explode attributes defined for the parameter.
- Format the parameter as described in the following:
Style | Explode | Primitive Type | Array Type | Object Type |
---|---|---|---|---|
Simple | false | blue | blue,red,green | R,100,G,200,B,150 |
true | Blue | Blue,red,green | R=100,G=200,B=150 |
- Add the formatted parameter to the API request URL.
Example Definition
Example Curl URL
curl -X 'GET' \
'https://editor.swagger.io/api/v3/header/explode-true' \
-H 'accept: application/json' \
-H 'id: available' \
-H 'idArr: 1,2' \
-H 'idObj: idname=string,idvalue=0'
How to Build Cookie Parameter for an OpenAPI Request?
Cookie parameters follow the “form” style format.
Semantics for the parameter may vary based on the schema type and the value defined for the explode attribute in the parameter definition.
Pre-Conditions
- User is provided with an OpenAPI document from the service provider.
- The OpenAPI document has an API with a cookie parameter.
Basic Flow
- From the OpenAPI document, identify the API to be invoked.
- If the API defines a cookie parameter, select the parameter name.
- Check the style and the explode attributes defined for the parameter.
- Format the parameter as described in the following table:
Style | Explode | Primitive Type | Array Type | Object Type |
---|---|---|---|---|
form | false | color=blue | color=blue,red,green | color=R,100,G,200,B,150 |
true | color=blue | color=blue&color=red&color=green | R=100&G=200&B=150 |
- Add the formatted parameter to the API request URL.
Example Definition
Example Curl URL
curl -X 'GET' \
'https://editor.swagger.io/api/v3/cookie/explode-true' \
-H 'accept: application/json' \
-H 'Cookie: idname=string&idvalue=0'
How to Build complex Object Parameter for an OpenAPI Request?
OpenAPI Specification allows you to send more complex objects as values for all types of parameters it supports.
These complex objects are built using a particular MediaType format. For example, application/xml and application/json.
Integration Server supports only the following media types:
- application/json
- application/xml
- text/xml
- text/plain
Pre-Conditions
- User is provided with an OpenAPI document from Service Provider.
- The OpenAPI document has an API with a parameter defined with content.
Basic Flow
- From the OpenAPI document, identify the API to be invoked.
- If the API defines the content, select the media type of the parameter.
- Get the schema for the content defined and build the data in the format defined by MediaType .
For example,
- Add the formatted value against the parameter in the API request URL.
How to build request Body for an OpenAPI Request?
The OpenAPI provider defines the request body for an API. The body parameters are defined by the content attribute with one or more media type.
webMethods Integration Server supports only the following media types:
- application/json
- application/xml
- text/xml
- text/plain
Pre-Conditions
- User is provided with an OpenAPI document from Service Provider.
- The OpenAPI document has an API with a request body.
Basic Flow
- From the OpenAPI document, identify the API to be invoked.
- If the API defines the content, select the media type of the request.
- Get the schema definition for the media type selected.
- If the chosen mediaType is “application/xml”, ensure that the XML data is built with a single root element. Without a single root element, the XML structure is considered as invalid.
- For the XML structures, OpenAPI Specification defines the “XML” element for the schema. If the XML element defines the name attribute, ensure that the root element has the same name as the name attribute.
- To build the correct and compatible request payload structure, it is recommended to use the Swagger editor. The Swagger editor generates the example structure of each media type for every API that expects a request body.
For example,
- Add the formatted data to the request body.
References
OpenAPI Specification - Version 3.0.2 | Swagger
REST Capabilities In Integration Server - Knowledge base - Software AG Tech Community & Forums