You can define media types in request and response definitions when you connect to the REST endpoint.
In Swagger, you can specify the following media types in request and response definitions to process data:
application/xml
application/json
application/x-www-form-urlencoded
JSON subtype. For example:
application/
hal+
json
JSON custom type. For example:
application/
vnd.ds.abc.v1+
json
Extended JSON mime type. For example:
application/vnd.ds.abc.v1+json;
version=q1
text/xml
If a swagger definition contains multiple mime types in consumes and produces attribute values, the REST V2 Connector considers the payload to be of first mime type in the list.
In OpenAPI, you can specify the following media types in request and response definitions to process data:
application/xml
application/json
Consider the following guidelines when you define media types in OpenAPI:
The default request and response media type for all operations is
application/json
.
If
application/json
media type is not available for an operation, the task considers
application/xml
as the request and response media type.
If
application/json
or
application/xml
media type is not available for an operation, the request message template displays a static field named Request_Port and the field mapping displays a static field named Response_Port.
Operations
You can define operations to connect to the REST endpoint.
You can use the following REST methods or operations in source, target, and midstream transformations in Swagger or OpenAPI: