{ "$schema": "http://json-schema.org/draft-04/schema#", "title": "Kragle-block_type-schema-v1.0", "type": "object", "properties": { "io": { "type": "object", "properties": { "input": { "type": ["null", "string", "array"], "items": {"type": "string"}, "maxItems": 1 }, "output": { "type": ["null", "string", "array"], "items": {"type": "string"}, "maxItems": 1 } }, "required": ["input", "output"] }, "actions": { "type": "array", "minItems": 1, "items": { "type": "object", "oneOf": [ { "properties": { "action": {"type": "string", "enum": ["uri_get", "uri_head", "uri_get_with_headers", "uri_head_with_headers"]}, "action_params": { "type": "object", "properties": { "uri": {"type": "string"}, "headers": {"type": "object", "additionalProperties": {"type": "string"}}, "response_type": {"type": "string", "enum": ["string", "json", "xml"]}, "auth_required": {"type": "boolean"}, "auth_type": {"type": "string", "enum": ["strategy", "basic"]}, "auth_meta": { "type": "object", "properties": { "scope": {"type": "string"} } } }, "dependencies": {"auth_required": ["auth_type"]}, "required": ["uri"] } }, "required": ["action", "action_params"] }, { "properties": { "action": {"type": "string", "enum": ["uri_post", "uri_post_with_headers"]}, "action_params": { "type": "object", "properties": { "uri": {"type": "string"}, "headers": {"type": "object", "additionalProperties": {"type": "string"}}, "response_type": {"type": "string", "enum": ["string", "json"]}, "body": {"type": "string"}, "auth_required": {"type": "boolean"}, "auth_type": {"type": "string", "enum": ["strategy", "basic"]}, "auth_meta": { "type": "object", "properties": { "scope": {"type": "string"} } } }, "dependencies": {"auth_required": ["auth_type"]}, "required": ["uri"] } }, "required": ["action", "action_params"] }, { "properties": { "action": {"type": "string", "enum": ["debug"]}, "action_params": {"type": "object"} }, "required": ["action", "action_params"] }, { "properties": { "action": {"type": "string", "enum": ["read_instance_state"]}, "action_params": { "type": "object", "properties": { "id": {"type": "string"} }, "required": ["id"] } }, "required": ["action", "action_params"] }, { "properties": { "action": {"type": "string", "enum": ["write_instance_state"]}, "action_params": { "type": "object", "properties": { "id": {"type": "string"}, "new_state": {"type": "object"}, "predicate": {"type": "object"} }, "required": ["id", "new_state"] } }, "required": ["action", "action_params"] }, { "properties": { "action": {"type": "string", "enum": ["predicate_match", "predicate_not_match"]}, "action_params": { "type": "object", "properties": { "test": {"type": "string"}, "value": {"type": "string"} }, "required": ["test", "value"] } }, "required": ["action", "action_params"] }, { "properties": { "action": {"type": "string", "enum": ["predicate_re_match", "predicate_not_re_match"]}, "action_params": { "type": "object", "properties": { "test": {"type": "string"}, "expr": {"type": "string"} }, "required": ["test", "expr"] } }, "required": ["action", "action_params"] }, { "properties": { "action": {"type": "string", "enum": ["convert"]}, "action_params": { "type": "object", "properties": { "conversion": {"type": ["object", "array", "string", "null"]} }, "required": ["conversion"] } }, "required": ["action", "action_params"] }, { "properties": { "action": {"type": "string", "enum": ["exclude_in"]}, "action_params": { "type": "object", "properties": { "exclusions": {"type": ["object", "array", "string", "null"]}, "element_path": {"type": ["object", "array", "string", "null"]} }, "required": ["exclusions", "element_path"] } }, "required": ["action", "action_params"] }, { "properties": { "action": {"type": "string", "enum": ["filter"]}, "action_params": { "type": "object", "properties": { "exclusions": {"type": ["object", "array", "string", "null"]} }, "required": ["exclusions"] } }, "required": ["action", "action_params"] }, { "properties": { "action": {"type": "string", "enum": ["take_first", "take_last", "take_head", "take_tail"]}, "action_params": {"type": "object"} }, "required": ["action", "action_params"] } ] } }, "state": { "type": "object", "properties": { "input": { "type": "object", "additionalProperties": {"type": ["object", "array", "string", "null"]} }, "output": { "type": "object", "additionalProperties": {"type": ["object", "array", "string", "null"]} } }, "required": ["input", "output"] }, "initial_state": { "type": "object", "properties": { "input": { "type": "object", "additionalProperties": true }, "output": { "type": "object", "additionalProperties": true } }, "required": ["input", "output"] } }, "required": ["io", "actions", "state", "initial_state"] }