Introduction - Schema Usage & Examples
  • 21 Nov 2022
  • Dark
    Light
  • PDF

Introduction - Schema Usage & Examples

  • Dark
    Light
  • PDF

Article Summary

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?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.