{ "id": "http://sugos.tech/schemas/module-spec", "$schema": "http://json-schema.org/draft-04/schema#", "title": "Spec of SUGOS-Actor module", "type": "object", "properties": { "name": { "$ref": "#/definitions/name", "minLength": 1, "description": "Name of module" }, "version": { "$ref": "#/definitions/semver", "description": "Version number with semver format" }, "desc": { "$ref": "#/definitions/text", "description": "Description text" }, "methods": { "$ref": "#/definitions/functions", "description": "Method signature" }, "events": { "$ref": "#/definitions/events", "description": "Events to emit" } }, "additionalProperties": true, "required": [ "name", "version" ], "definitions": { "name": { "type": "string", "pattern": "^[A-Za-z](?:[_\\.-]?[A-Za-z0-9]+)*$" }, "semver": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+(?:-[a-z]+(?:[_\\.-]*[a-z0-9]+)*)*$" }, "text": { "type": "string", "maxLength": "1024" }, "functions": { "type": "object", "patternProperties": { ".*": { "$ref": "#/definitions/function" } } }, "function": { "type": "object", "properties": { "name": { "$ref": "#/definitions/name", "description": "Name of the function" }, "desc": { "$ref": "#/definitions/text", "description": "Description of the function" }, "params": { "type": "array", "description": "Parameters of the function", "items": { "$ref": "#/definitions/functionParam" } }, "return": { "$ref": "#/definitions/functionReturn", "description": "Value to return" } } }, "functionParam": { "type": "object", "properties": { "name": { "$ref": "#/definitions/name", "description": "Name of the parameter" }, "type": { "$ref": "#/definitions/type", "description": "Type of the parameter" }, "desc": { "$ref": "#/definitions/text", "description": "Description of parameter" } } }, "functionReturn": { "type": "object", "properties": { "type": { "$ref": "#/definitions/type", "description": "Type of the parameter" }, "desc": { "$ref": "#/definitions/text", "description": "Description of parameter" } } }, "events": { "type": "object", "patternProperties": { ".*": { "$ref": "#/definitions/event" } } }, "event": { "type": "object", "properties": { "name": { "$ref": "#/definitions/name", "description": "Name of the event" }, "desc": { "$ref": "#/definitions/text", "description": "Description of the event" } } } } }