Skip to content

Commit e0b56c5

Browse files
committed
Move version to header and flatten responses
1 parent 4ebed7f commit e0b56c5

1 file changed

Lines changed: 68 additions & 44 deletions

File tree

spec/http/1.0/openapi.json

Lines changed: 68 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,20 @@
1818
"operationId": "health-check",
1919
"summary": "Check health",
2020
"description": "Checks the health status of the server.",
21+
"parameters": [
22+
{
23+
"$ref": "#/components/parameters/OXPVersionSelectorHeader"
24+
}
25+
],
2126
"security": [{}],
2227
"responses": {
2328
"200": {
24-
"description": "Server is healthy."
29+
"description": "Server is healthy.",
30+
"headers": {
31+
"OXP-Version": {
32+
"$ref": "#/components/headers/OXPServerHeader"
33+
}
34+
}
2535
},
2636
"503": {
2737
"description": "Server is unhealthy and cannot accept requests."
@@ -34,38 +44,29 @@
3444
"operationId": "list-tools",
3545
"summary": "List tools",
3646
"description": "Returns a list of tool definitions.",
47+
"parameters": [
48+
{
49+
"$ref": "#/components/parameters/OXPVersionSelectorHeader"
50+
}
51+
],
3752
"security": [
3853
{
3954
"bearerAuth": []
4055
},
4156
{}
4257
],
43-
"requestBody": {
44-
"required": false,
45-
"content": {
46-
"application/json": {
47-
"schema": {
48-
"properties": {
49-
"$schema": {
50-
"type": "string",
51-
"format": "uri"
52-
}
53-
}
54-
}
55-
}
56-
}
57-
},
5858
"responses": {
5959
"200": {
6060
"description": "A list of available tools.",
61+
"headers": {
62+
"OXP-Version": {
63+
"$ref": "#/components/headers/OXPServerHeader"
64+
}
65+
},
6166
"content": {
6267
"application/json": {
6368
"schema": {
6469
"properties": {
65-
"$schema": {
66-
"type": "string",
67-
"format": "uri"
68-
},
6970
"items": {
7071
"type": "array",
7172
"items": {
@@ -79,7 +80,12 @@
7980
}
8081
},
8182
"401": {
82-
"description": "Unauthorized. The request requires authentication, but the provided credentials are invalid or missing."
83+
"description": "Unauthorized. The request requires authentication, but the provided credentials are invalid or missing.",
84+
"headers": {
85+
"OXP-Version": {
86+
"$ref": "#/components/headers/OXPServerHeader"
87+
}
88+
}
8389
}
8490
}
8591
}
@@ -89,6 +95,11 @@
8995
"operationId": "call-tool",
9096
"summary": "Call tool",
9197
"description": "Calls a tool with the given parameters.",
98+
"parameters": [
99+
{
100+
"$ref": "#/components/parameters/OXPVersionSelectorHeader"
101+
}
102+
],
92103
"security": [
93104
{
94105
"bearerAuth": []
@@ -100,42 +111,34 @@
100111
"content": {
101112
"application/json": {
102113
"schema": {
103-
"properties": {
104-
"$schema": {
105-
"type": "string",
106-
"format": "uri"
107-
},
108-
"request": {
109-
"$ref": "#/components/schemas/CallToolRequest"
110-
}
111-
},
112-
"required": ["request"]
114+
"$ref": "#/components/schemas/CallToolRequest"
113115
}
114116
}
115117
}
116118
},
117119
"responses": {
118120
"200": {
119121
"description": "Response from tool.",
122+
"headers": {
123+
"OXP-Version": {
124+
"$ref": "#/components/headers/OXPServerHeader"
125+
}
126+
},
120127
"content": {
121128
"application/json": {
122129
"schema": {
123-
"properties": {
124-
"$schema": {
125-
"type": "string",
126-
"format": "uri"
127-
},
128-
"result": {
129-
"$ref": "#/components/schemas/CallToolResponse"
130-
}
131-
},
132-
"required": ["result"]
130+
"$ref": "#/components/schemas/CallToolResponse"
133131
}
134132
}
135133
}
136134
},
137135
"400": {
138136
"description": "The request is invalid or could not be processed.",
137+
"headers": {
138+
"OXP-Version": {
139+
"$ref": "#/components/headers/OXPServerHeader"
140+
}
141+
},
139142
"content": {
140143
"application/json": {
141144
"schema": {
@@ -144,11 +147,13 @@
144147
}
145148
}
146149
},
147-
"401": {
148-
"description": "Unauthorized. The request requires authentication, but the provided credentials are invalid or missing."
149-
},
150150
"422": {
151151
"description": "The tool call is valid, but the parameters are invalid (missing, incorrect type, etc).",
152+
"headers": {
153+
"OXP-Version": {
154+
"$ref": "#/components/headers/OXPServerHeader"
155+
}
156+
},
152157
"content": {
153158
"application/json": {
154159
"schema": {
@@ -169,6 +174,25 @@
169174
"bearerFormat": "JWT"
170175
}
171176
},
177+
"parameters": {
178+
"OXPVersionSelectorHeader": {
179+
"name": "OXP-Version",
180+
"in": "header",
181+
"description": "Optional header to specify the version of the OXP protocol to use.",
182+
"required": false,
183+
"schema": {
184+
"type": "string"
185+
}
186+
}
187+
},
188+
"headers": {
189+
"OXPServerHeader": {
190+
"description": "The OXP version used by the server",
191+
"schema": {
192+
"type": "string"
193+
}
194+
}
195+
},
172196
"schemas": {
173197
"ToolId": {
174198
"type": "string",

0 commit comments

Comments
 (0)