@burgan-tech/vnext-schema
Version:
JSON Schema definitions for vNext vNext Workflow components validation
196 lines • 7.71 kB
JSON
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://vnext.com/schemas/function-definition.schema.json",
"title": "vNext Function Definition",
"description": "Schema for vNext Function Component Definition JSON files (sys-functions flow)",
"type": "object",
"required": [
"key",
"version",
"domain",
"flow",
"flowVersion",
"tags",
"attributes"
],
"properties": {
"$schema": {
"type": "string",
"description": "JSON Schema reference",
"format": "uri"
},
"key": {
"type": "string",
"description": "Function key identifier",
"pattern": "^[a-z0-9-]+$"
},
"version": {
"type": "string",
"description": "Version in Major.Minor.Patch format",
"pattern": "^\\d+\\.\\d+\\.\\d+$"
},
"domain": {
"type": "string",
"description": "Domain identifier",
"pattern": "^[a-z0-9-]+$"
},
"flow": {
"type": "string",
"description": "Flow identifier for functions",
"const": "sys-functions"
},
"flowVersion": {
"type": "string",
"description": "Flow version",
"pattern": "^\\d+\\.\\d+\\.\\d+$"
},
"tags": {
"type": "array",
"description": "Function tags",
"items": {
"type": "string"
},
"minItems": 1
},
"attributes": {
"type": "object",
"description": "Function definition attributes",
"required": [
"scope",
"task"
],
"properties": {
"scope": {
"type": "string",
"description": "Function scope (TaskScope enum value)",
"enum": [
"D",
"F",
"I"
],
"enumDescriptions": [
"Domain",
"Flow",
"Instance"
]
},
"task": {
"type": "object",
"description": "Function execution task",
"required": [
"order",
"task",
"mapping"
],
"properties": {
"order": {
"type": "integer",
"description": "Task execution order",
"minimum": 1
},
"task": {
"description": "Task reference - can be either explicit reference or $ref",
"oneOf": [
{
"type": "object",
"description": "Explicit task reference",
"required": [
"key",
"domain",
"flow",
"version"
],
"properties": {
"key": {
"type": "string",
"description": "Task key"
},
"domain": {
"type": "string",
"description": "Task domain"
},
"flow": {
"type": "string",
"description": "Task workflow",
"const": "sys-tasks"
},
"version": {
"type": "string",
"description": "Task version",
"pattern": "^\\d+\\.\\d+\\.\\d+$"
}
},
"additionalProperties": false
},
{
"type": "object",
"description": "Task reference using ref",
"required": [
"ref"
],
"properties": {
"ref": {
"type": "string",
"description": "Reference to task file"
}
},
"additionalProperties": false
}
]
},
"mapping": {
"type": "object",
"description": "Function mapping code",
"required": [
"location",
"code"
],
"properties": {
"location": {
"type": "string",
"description": "Code file location",
"pattern": "^\\./.*\\.csx$"
},
"code": {
"type": "string",
"description": "Mapping code content",
"minLength": 1
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"labels": {
"type": "array",
"description": "Multi-language labels for function",
"items": {
"type": "object",
"required": [
"label",
"language"
],
"properties": {
"label": {
"type": "string",
"minLength": 1
},
"language": {
"type": "string",
"pattern": "^[a-z]{2}-[A-Z]{2}$",
"examples": [
"en-US",
"tr-TR",
"de-DE"
]
}
}
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}