The open source OpenXR runtime
at prediction-2 125 lines 4.0 kB view raw
1{ 2 "$schema": "http://json-schema.org/draft-07/schema", 3 "$id": "http://gitlab.freedesktop.org/monado/monado/src/xrt/ipc/proto.schema.json", 4 "type": "object", 5 "title": "Protocol schema", 6 "description": "The root schema for an entire protocol.", 7 "definitions": { 8 "scalar": { 9 "$comment": "Must keep this list synchronized with the one in ipcproto/common.py", 10 "title": "Known scalar type", 11 "type": "string", 12 "enum": [ 13 "uint32_t", 14 "int64_t", 15 "uint64_t", 16 "bool", 17 "float" 18 ] 19 }, 20 "aggregate": { 21 "$comment": "Must keep this pattern synchronized with the one in ipcproto/common.py", 22 "title": "Struct or union type", 23 "type": "string", 24 "pattern": "(struct|union) (xrt|ipc)_[a-z_]+" 25 }, 26 "scalar_enum": { 27 "$comment": "Must keep this list synchronized with the one in ipcproto/common.py", 28 "title": "Custom enum (scalar)", 29 "type": "string", 30 "pattern": "enum xrt_[a-z_]+" 31 }, 32 "handle": { 33 "$comment": "Must keep this pattern synchronized with the one in ipcproto/common.py", 34 "title": "Native handle typedef", 35 "type": "string", 36 "pattern": "xrt_([a-z_]+)_handle_t" 37 }, 38 "param": { 39 "type": "object", 40 "title": "Parameter", 41 "required": [ 42 "name", 43 "type" 44 ], 45 "properties": { 46 "name": { 47 "title": "Parameter name", 48 "type": "string" 49 }, 50 "type": { 51 "title": "Parameter type", 52 "anyOf": [ 53 { 54 "$ref": "#/definitions/scalar" 55 }, 56 { 57 "$ref": "#/definitions/aggregate" 58 }, 59 { 60 "$ref": "#/definitions/scalar_enum" 61 } 62 ] 63 } 64 } 65 }, 66 "param_list": { 67 "title": "Parameter list", 68 "type": "array", 69 "additionalItems": { 70 "$ref": "#/definitions/param" 71 } 72 } 73 }, 74 "properties": { 75 "$schema": { 76 "type": "string" 77 } 78 }, 79 "additionalProperties": { 80 "$id": "#/call", 81 "type": "object", 82 "title": "IPC Call", 83 "properties": { 84 "id": { 85 "type": "string", 86 "title": "Call ID", 87 "description": "If left unspecified or empty, the ID will be constructed by prepending IPC_ to the call name in all upper-case." 88 }, 89 "out_handles": { 90 "$id": "#/call/properties/out_handles", 91 "type": "object", 92 "title": "Handles for call to return", 93 "required": [ 94 "type" 95 ], 96 "properties": { 97 "type": { 98 "$ref": "#/definitions/handle" 99 } 100 } 101 }, 102 "in_handles": { 103 "$id": "#/call/properties/in_handles", 104 "type": "object", 105 "title": "Handles supplied to call", 106 "required": [ 107 "type" 108 ], 109 "properties": { 110 "type": { 111 "$ref": "#/definitions/handle" 112 } 113 } 114 }, 115 "in": { 116 "title": "Input parameters", 117 "$ref": "#/definitions/param_list" 118 }, 119 "out": { 120 "title": "Output parameters", 121 "$ref": "#/definitions/param_list" 122 } 123 } 124 } 125}