#
Schema.json file
Refer to the following steps:
Anatomy of schema.json file Building features and schemas Supported Data Types
#
Anatomy of schema.json file
#
Top-level Structure
The schema.json file is a structured configuration file that defines the behavior and interface of a connector or tool. It consists of the following main sections:
{
"id": "unique.identifier",
"name": "Display Name",
"version": 1,
"tags": ["category", "subcategory"],
"features": [...],
"configuration": {},
"exceptions": [...],
"schema": [...],
"deployment": {...}
}
#
Key Components
- Id: Unique identifier for the connector/tool (e.g., "connectors.send-email-connector")
- Name: Display name of the connector/tool
- Version: Version number of the schema
- Tags: Categorization labels for the connector/tool
- Features: Defines available operations and their schemas
- Configuration: Global configuration settings
- Exceptions: List of possible exceptions
- Schema: Detailed schema definitions for inputs and outputs
- Deployment: Deployment configuration for the container
#
Building features and schemas
#
Feature Definition
Features are defined in the features array of the schema.json file. Each feature represents a specific operation or functionality of the connector/tool.
"features": [
{
"feature_name": {
"input_schema": "request_schema_name",
"output_schema": "response_schema_name",
"configuration": null,
"exceptions": ["namespace.error_type"],
"displayname": "User-Friendly Name",
"hidden": false
}
}
]
#
Feature Components
- Feature Name: Unique identifier for the feature
- Input Schema: Reference to the request schema definition
- Output Schema: Reference to the response schema definition
- Configuration: Feature-specific configuration (if any)
- Exceptions: List of possible exceptions
- Display Name: User-friendly name for the feature
- Hidden: Visibility flag for the feature
#
Building request schemas
Request schemas define the input parameters for a feature:
{
"request_schema_name": {
"entities": [
{
"field_name": {
"displayname": "Field Display Name",
"datatype": "string|object|file|connection",
"is_array": false,
"mandatory": true,
"parameters": false,
"properties": {
"value_key": "field_name",
"component": "input|connectionSelect",
"display_order": 1,
"label": "Field Label",
"placeholder": "Placeholder Text",
"parameter": true,
"help_text": "Help text for the field"
}
}
}
]
}
}
#
Building response schemas
Response schemas define the output structure of a feature:
{
"response_schema_name": {
"entities": [
{
"result_field": {
"displayname": "Result Field Name",
"datatype": "string|object|file",
"is_array": false,
"mandatory": true,
"properties": {}
}
}
]
}
}
#
Supported Data Types
Below are the supported data types in schema.json
Data Type - String
Description - Represents textual information
Usage:{ "datatype": "string", "is_array": false, "mandatory": true, "properties": { "value_key": "field_name", "component": "input", "display_order": 1, "label": "Field Label", "parameter": true, "placeholder": "Enter value", "help_text": "Help text for the field" } }Data Type - Objects
Description - Represents key-value pairs
Usage:{ "datatype": "object", "is_array": false, "mandatory": true, "properties": { "value_key": "field_name", "display_order": 1, "label": "Field Label", "parameter": true, "placeholder": "Select JSON", "help_text": "Help text for the field" } }Data Type - File
Description - Represents documents in Purple Fabric
Usage:{ "datatype": "file", "is_array": true, "min_count": 1, "max_count": -1, "mandatory": true, "values": ["png", "jpg", "jpeg", "pdf", "tif", "tiff"], "properties": { "value_key": "files", "parameter": true, "display_order": 4, "label": "Input", "help_text": "Select the files to be uploaded to the specified S3 folder." }, "entities": { "file_ref_id": { "datatype": "string", "mandatory": true, "hidden": false }, "mime_type": { "datatype": "string", "mandatory": false, "hidden": false }, "file_name": { "datatype": "string", "mandatory": true, "hidden": false }, "file_id": { "datatype": "string", "mandatory": false, "hidden": false } } }Data Type - Connection
Description - Represents a credential in Purple Fabric
Usage:{ "datatype": "connection", "mandatory": true, "hidden": false, "displayname": "Connection", "properties": { "label": "Connection", "options": [], "placeholder_text": "Select Connection", "component": "connectionSelect", "help_text": "Choose a connection", "parameter": true, "value_key": "connection", "display_order": 1, "option_label_key": "name", "option_value_key": "connection_id", "provider_name": "Service Name" } }Data Type - Number
Description - Represents numerical data
Usage:{ "datatype": "number", "mandatory": true, "hidden": false, "properties": { "value_key": "field_name", "component": "input", "parameter": true, "display_order": 1, "label": "Field Label", "help_text": "Help text for the field" } }