{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "title": "RCP Client to RCP Server",
    "type": "object",
    "properties": {
	"rcpc_hello": {
	    "type": "object",
	    "properties": {
		"suitable_for": {
		    "type": "object",
		    "properties": {
			"atr": {
			    "type": "string",
			    "pattern": "^[0-9,A-F]{0,66}$"
			}
		    },
		    "oneOf": [
			{ "required": [ "atr" ] }
		    ],
		    "additionalProperties": false
		}
	    },
	    "required": [ "suitable_for" ],
	    "additionalProperties": false
	},
	"rcpc_command": {
	    "type": "object",
	    "properties": {
		"cmd": {
		    "type": "string",
		    "pattern": "^[0-9,A-Z,a-z,_]{0,40}$"
		},
		"cmd_argv": {
		    "type": "array",
		    "items": {
			"type": "string",
			"pattern": "^.{0,512}$"
		    },
		    "maxItems": 255
		}
	    },
	    "required": [ "cmd", "cmd_argv" ],
	    "additionalProperties": false
	},
	"rcpc_result": {
	    "type": "object",
	    "properties": {
		"r_apdu": {
		    "type": "object",
		    "properties": {
			"data": {
			    "type": "string",
			    "pattern": "^[0-9,A-F]{0,512}$"
			},
			"sw": {
			    "type": "string",
			    "pattern": "^[0-9,A-F]{0,4}$"
			}
		    },
		    "required": [ "data", "sw" ],
		    "additionalProperties": false
		},
		"atr": {
		    "type": "string",
		    "pattern": "^[0-9,A-F]{0,66}$"
		},
		"empty": {
		    "type": "null"
		}
	    },
	    "oneOf": [
		{ "required": [ "r_apdu" ] },
		{ "required": [ "atr" ] },
		{ "required": [ "empty" ] }
	    ],
	    "additionalProperties": false
	}
    },
    "oneOf": [
	{ "required": [ "rcpc_hello" ] },
	{ "required": [ "rcpc_command" ] },
	{ "required": [ "rcpc_result" ] }
    ],
    "additionalProperties": false
}
