返回 CodeWhale
JSONRPCMessage.json
根目录 / crates / app-server-protocol / tests / pinned / JSONRPCMessage.json
1 {
2 "$schema": "http://json-schema.org/draft-07/schema#",
3 "anyOf": [
4 {
5 "$ref": "#/definitions/JSONRPCRequest"
6 },
7 {
8 "$ref": "#/definitions/JSONRPCNotification"
9 },
10 {
11 "$ref": "#/definitions/JSONRPCResponse"
12 },
13 {
14 "$ref": "#/definitions/JSONRPCError"
15 }
16 ],
17 "definitions": {
18 "JSONRPCError": {
19 "description": "A response to a request that indicates an error occurred.",
20 "properties": {
21 "error": {
22 "$ref": "#/definitions/JSONRPCErrorError"
23 },
24 "id": {
25 "$ref": "#/definitions/RequestId"
26 }
27 },
28 "required": [
29 "error",
30 "id"
31 ],
32 "type": "object"
33 },
34 "JSONRPCErrorError": {
35 "properties": {
36 "code": {
37 "format": "int64",
38 "type": "integer"
39 },
40 "data": true,
41 "message": {
42 "type": "string"
43 }
44 },
45 "required": [
46 "code",
47 "message"
48 ],
49 "type": "object"
50 },
51 "JSONRPCNotification": {
52 "description": "A notification which does not expect a response.",
53 "properties": {
54 "method": {
55 "type": "string"
56 },
57 "params": true
58 },
59 "required": [
60 "method"
61 ],
62 "type": "object"
63 },
64 "JSONRPCRequest": {
65 "description": "A request that expects a response.",
66 "properties": {
67 "id": {
68 "$ref": "#/definitions/RequestId"
69 },
70 "method": {
71 "type": "string"
72 },
73 "params": true,
74 "trace": {
75 "anyOf": [
76 {
77 "$ref": "#/definitions/W3cTraceContext"
78 },
79 {
80 "type": "null"
81 }
82 ],
83 "description": "Optional W3C Trace Context for distributed tracing."
84 }
85 },
86 "required": [
87 "id",
88 "method"
89 ],
90 "type": "object"
91 },
92 "JSONRPCResponse": {
93 "description": "A successful (non-error) response to a request.",
94 "properties": {
95 "id": {
96 "$ref": "#/definitions/RequestId"
97 },
98 "result": true
99 },
100 "required": [
101 "id",
102 "result"
103 ],
104 "type": "object"
105 },
106 "RequestId": {
107 "anyOf": [
108 {
109 "type": "string"
110 },
111 {
112 "format": "int64",
113 "type": "integer"
114 }
115 ]
116 },
117 "W3cTraceContext": {
118 "properties": {
119 "traceparent": {
120 "type": [
121 "string",
122 "null"
123 ]
124 },
125 "tracestate": {
126 "type": [
127 "string",
128 "null"
129 ]
130 }
131 },
132 "type": "object"
133 }
134 },
135 "description": "Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.",
136 "title": "JSONRPCMessage"
137 }
137 lines JSON