RESOURCE SCHEMA · CC BY 4.0 Source Service schema
{
"type": "object",
"additionalProperties": false,
"required": [
"name",
"description",
"type",
"spec"
],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"description": "Resource name, unique among Service resources in this System. Used exactly in filenames and references.",
"pattern": "^[A-Za-z0-9_-]+$"
},
"description": {
"type": "string",
"minLength": 1
},
"type": {
"enum": [
"http",
"tcp",
"database",
"storage",
"cache",
"smtp",
"mom",
"secrets"
]
},
"audiences": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]+$",
"description": "Exact name of the referenced resource, unique within its resource type in this System.",
"minLength": 1
},
"description": "Omitted or empty means shared by all Audiences; otherwise assigned to the listed Audiences."
},
"spec": {
"type": "object",
"additionalProperties": true,
"description": "Service configuration. Outbound Service values can reference declared Secrets with publication-time {{ security.secrets.<name> }} expressions, including object properties. Runtime-bound configuration is supplied by provisioning."
},
"protocols": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"name",
"definition"
],
"properties": {
"name": {
"type": "string",
"pattern": "^[A-Za-z][A-Za-z0-9_.-]{0,119}$"
},
"definition": {
"$ref": "#/$defs/tcpProtocol",
"description": "Native TCP protocol definition, packaged unchanged. Service.md explains the existing wire behavior."
}
}
}
},
"exchanges": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"name",
"requestProtocol",
"responseProtocol",
"async"
],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 160,
"description": "Business exchange name used by Processes."
},
"requestProtocol": {
"type": "string",
"pattern": "^[A-Za-z][A-Za-z0-9_.-]{0,119}$"
},
"responseProtocol": {
"type": "string",
"pattern": "^[A-Za-z][A-Za-z0-9_.-]{0,119}$"
},
"async": {
"type": "boolean",
"description": "True runs the complete framed request/response exchange on the application executor and immediately returns null to the caller. The background response is consumed and discarded."
}
}
}
},
"secrets": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]+$",
"minLength": 1,
"description": "Exact name of the referenced resource, unique within its resource type in this System."
},
"description": "Exact names of declared Secrets used by the Service. Document the needed values or object properties; publication supplies approved configuration."
}
},
"$defs": {
"tcpProtocol": {
"type": "object",
"additionalProperties": false,
"required": [
"frame",
"sections"
],
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"frame": {
"type": "object",
"additionalProperties": false,
"required": [
"length",
"type"
],
"properties": {
"length": {
"type": "integer",
"minimum": 1
},
"type": {
"enum": [
"uint",
"binary",
"ascii",
"numeric"
]
},
"endian": {
"enum": [
"big",
"little"
],
"default": "big",
"description": "Parser accepts both; current integer framing writes big-endian. See Service.md."
}
}
},
"sections": {
"type": "object",
"minProperties": 1,
"additionalProperties": {
"$ref": "#/$defs/tcpSection"
}
}
}
},
"tcpBitmap": {
"type": "object",
"additionalProperties": false,
"properties": {
"primary": {
"type": "integer",
"minimum": 1
},
"secondary": {
"type": "integer",
"minimum": 0
},
"type": {
"enum": [
"binary",
"ascii"
],
"default": "binary"
},
"bitOrder": {
"enum": [
"msb",
"lsb"
],
"default": "msb"
}
},
"required": [
"primary"
]
},
"tcpSection": {
"type": "object",
"additionalProperties": false,
"required": [
"fields"
],
"properties": {
"fields": {
"type": "array",
"items": {
"$ref": "#/$defs/tcpField"
}
},
"bitmap": {
"$ref": "#/$defs/tcpBitmap"
}
}
},
"tcpFieldLength": {
"type": "object",
"additionalProperties": false,
"required": [
"format"
],
"properties": {
"format": {
"enum": [
"fixed",
"prefixed",
"remaining"
]
},
"value": {
"type": "integer",
"minimum": 0
},
"min": {
"type": "integer",
"minimum": 0
},
"max": {
"type": "integer",
"minimum": 0
}
},
"allOf": [
{
"if": {
"properties": {
"format": {
"enum": [
"fixed",
"prefixed"
]
}
},
"required": [
"format"
]
},
"then": {
"required": [
"value"
]
}
}
]
},
"tcpField": {
"type": "object",
"additionalProperties": false,
"required": [
"length"
],
"properties": {
"id": {
"type": "integer",
"minimum": 0
},
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"description": {
"type": "string"
},
"type": {
"enum": [
"ascii",
"numeric",
"binary",
"bcd",
"uint",
"msb",
"lsb"
],
"default": "ascii"
},
"endian": {
"enum": [
"big",
"little"
],
"default": "big"
},
"length": {
"$ref": "#/$defs/tcpFieldLength"
},
"fields": {
"type": "array",
"items": {
"$ref": "#/$defs/tcpField"
}
},
"bitmap": {
"$ref": "#/$defs/tcpBitmap"
},
"tlv": {
"type": "array",
"items": {
"$ref": "#/$defs/tcpTlv"
}
}
}
},
"tcpTlv": {
"type": "object",
"additionalProperties": false,
"required": [
"name",
"tag",
"length",
"value"
],
"properties": {
"name": {
"type": "string",
"minLength": 1
},
"tag": {
"type": "object",
"additionalProperties": false,
"required": [
"length"
],
"properties": {
"name": {
"type": "string"
},
"type": {
"enum": [
"binary",
"ascii",
"numeric",
"bcd",
"uint"
],
"default": "binary"
},
"endian": {
"enum": [
"big",
"little"
],
"default": "big"
},
"length": {
"type": "object",
"additionalProperties": false,
"required": [
"format",
"value"
],
"properties": {
"format": {
"const": "fixed"
},
"value": {
"type": "integer",
"minimum": 1
}
}
}
}
},
"length": {
"type": "object",
"additionalProperties": false,
"required": [
"type"
],
"properties": {
"type": {
"enum": [
"emv",
"binary",
"uint",
"ascii",
"numeric"
]
},
"format": {
"enum": [
"fixed",
"prefixed"
]
},
"value": {
"type": "integer",
"minimum": 1
}
},
"allOf": [
{
"if": {
"properties": {
"type": {
"enum": [
"binary",
"uint",
"ascii",
"numeric"
]
}
},
"required": [
"type"
]
},
"then": {
"required": [
"format",
"value"
]
}
}
]
},
"value": {
"type": "object",
"additionalProperties": false,
"required": [
"type"
],
"properties": {
"type": {
"enum": [
"binary",
"ascii",
"numeric",
"bcd",
"uint",
"msb",
"lsb"
]
}
}
}
}
},
"httpRequest": {
"type": "object",
"additionalProperties": false,
"description": "HTTP request settings. The body is a separate send argument. Supply a full URL in path here or in the send overrides.",
"properties": {
"verb": {
"anyOf": [
{
"enum": [
"get",
"post",
"put",
"delete",
"patch",
"head"
]
},
{
"type": "string",
"pattern": "^\\{\\{.+\\}\\}$"
}
],
"description": "Lowercase HTTP verb; default post. Only post, put and patch send the supplied body."
},
"path": {
"type": "string",
"minLength": 1,
"description": "Full HTTP or HTTPS destination URL, including any query string."
},
"headers": {
"anyOf": [
{
"type": "object",
"additionalProperties": {}
},
{
"type": "string",
"pattern": "^\\{\\{.+\\}\\}$"
}
],
"description": "Header names and values. Values are converted to text; declared Secret expressions can supply confidential values."
},
"timeout": {
"anyOf": [
{
"type": "integer",
"minimum": 1
},
{
"type": "string",
"pattern": "^\\{\\{.+\\}\\}$"
}
],
"description": "Positive request timeout in milliseconds; default 30000."
},
"async": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "string",
"pattern": "^\\{\\{.+\\}\\}$"
}
],
"description": "Default false. True submits asynchronously and returns null, discarding the response."
}
}
},
"httpSpec": {
"type": "object",
"additionalProperties": false,
"required": [
"type",
"request"
],
"properties": {
"type": {
"const": "net.http.native"
},
"version": {
"anyOf": [
{
"enum": [
"HTTP_1_1",
"HTTP_2"
]
},
{
"type": "string",
"pattern": "^\\{\\{.+\\}\\}$"
}
],
"description": "Default HTTP_1_1."
},
"connectTimeout": {
"anyOf": [
{
"type": "integer",
"minimum": 1
},
{
"type": "string",
"pattern": "^\\{\\{.+\\}\\}$"
}
],
"description": "Positive connection timeout in milliseconds; default 30000."
},
"ssl": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"description": "Optional approved key and certificate identifiers from declared Secrets. Uses the default SecretsProvider.",
"properties": {
"key": {
"type": "string"
},
"certificate": {
"type": "string"
},
"trustCAs": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "string",
"pattern": "^\\{\\{.+\\}\\}$"
}
]
}
}
},
{
"type": "string",
"pattern": "^\\{\\{.+\\}\\}$"
}
]
},
"request": {
"anyOf": [
{
"$ref": "#/$defs/httpRequest"
},
{
"type": "string",
"pattern": "^\\{\\{.+\\}\\}$"
}
]
}
}
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Service.schema.json",
"description": "One Service: a configured capability used by Processes. It can be shared by all Audiences or assigned to specific Audiences.",
"$id": "Service.schema.json",
"allOf": [
{
"if": {
"properties": {
"type": {
"const": "http"
}
},
"required": [
"type"
]
},
"then": {
"properties": {
"spec": {
"$ref": "#/$defs/httpSpec"
}
}
}
}
]
}