Introduction - Schema Usage & Examples
- 21 Nov 2022
-
DarkLight
-
PDF
Introduction - Schema Usage & Examples
- Updated on 21 Nov 2022
-
DarkLight
-
PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Defined in action.json
Schema is used to define the data that goes between the adapter and the other system. You can have a different schema definition for every call in an action file. You may also have different schemas for the request and response. Thus, you may see many schema files within an entity. You must have schema in the action.json file – so either the schema is required, or the requestSchema and responseSchema are required.
- schema: Default to use when the request and response do not have a specific schema or they have the same schema.
- requestSchema: Defines a schema specific to the request.
- responseSchema: Defines a schema specific to the response.
Example: action.json
"name": "getIP",
"protocol": "REST",
"method": "GET",
"entitypath": "{base_path}/{version}/addresses/{pathv1}",
"schema": "schema.json",
"requestSchema": "requestSchema.json",
"responseSchema": "responseSchema.json",
"timeout": 3000,
"sendEmpty": true,
"datatype": "PLAIN",
"headers": {},
"responseObjects": [
{
"type": "default",
"key": "",
"mockFile": ""
}
]
You can move all schemas into a subdirectory (e.g., mockdatafiles). Be sure the references to the schema in action.json are changed accordingly. So if the subdirectory is schemas then the action.json may look like
"requestSchema": "schemas/requestSchema.json",
"responseSchema": "schemas/responseSchema.json",
Was this article helpful?