Skip to content

Move version to header and flatten responses #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 74 additions & 45 deletions spec/http/1.0/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,28 @@
"operationId": "health-check",
"summary": "Check health",
"description": "Checks the health status of the server.",
"parameters": [
{
"$ref": "#/components/parameters/OXPVersionSelectorHeader"
}
],
"security": [{}],
"responses": {
"200": {
"description": "Server is healthy."
"description": "Server is healthy.",
"headers": {
"OXP-Version": {
"$ref": "#/components/headers/OXPServerHeader"
}
}
},
"503": {
"description": "Server is unhealthy and cannot accept requests."
"description": "Server is unhealthy and cannot accept requests.",
"headers": {
"OXP-Version": {
"$ref": "#/components/headers/OXPServerHeader"
}
}
}
}
}
Expand All @@ -34,38 +49,29 @@
"operationId": "list-tools",
"summary": "List tools",
"description": "Returns a list of tool definitions.",
"parameters": [
{
"$ref": "#/components/parameters/OXPVersionSelectorHeader"
}
],
"security": [
{
"bearerAuth": []
},
{}
],
"requestBody": {
"required": false,
"content": {
"application/json": {
"schema": {
"properties": {
"$schema": {
"type": "string",
"format": "uri"
}
}
}
}
}
},
"responses": {
"200": {
"description": "A list of available tools.",
"headers": {
"OXP-Version": {
"$ref": "#/components/headers/OXPServerHeader"
}
},
"content": {
"application/json": {
"schema": {
"properties": {
"$schema": {
"type": "string",
"format": "uri"
},
"items": {
"type": "array",
"items": {
Expand All @@ -79,7 +85,12 @@
}
},
"401": {
"description": "Unauthorized. The request requires authentication, but the provided credentials are invalid or missing."
"description": "Unauthorized. The request requires authentication, but the provided credentials are invalid or missing.",
"headers": {
"OXP-Version": {
"$ref": "#/components/headers/OXPServerHeader"
}
}
}
}
}
Expand All @@ -89,6 +100,11 @@
"operationId": "call-tool",
"summary": "Call tool",
"description": "Calls a tool with the given parameters.",
"parameters": [
{
"$ref": "#/components/parameters/OXPVersionSelectorHeader"
}
],
"security": [
{
"bearerAuth": []
Expand All @@ -100,42 +116,34 @@
"content": {
"application/json": {
"schema": {
"properties": {
"$schema": {
"type": "string",
"format": "uri"
},
"request": {
"$ref": "#/components/schemas/CallToolRequest"
}
},
"required": ["request"]
"$ref": "#/components/schemas/CallToolRequest"
}
}
}
},
"responses": {
"200": {
"description": "Response from tool.",
"headers": {
"OXP-Version": {
"$ref": "#/components/headers/OXPServerHeader"
}
},
"content": {
"application/json": {
"schema": {
"properties": {
"$schema": {
"type": "string",
"format": "uri"
},
"result": {
"$ref": "#/components/schemas/CallToolResponse"
}
},
"required": ["result"]
"$ref": "#/components/schemas/CallToolResponse"
}
}
}
},
"400": {
"description": "The request is invalid or could not be processed.",
"headers": {
"OXP-Version": {
"$ref": "#/components/headers/OXPServerHeader"
}
},
"content": {
"application/json": {
"schema": {
Expand All @@ -144,11 +152,13 @@
}
}
},
"401": {
"description": "Unauthorized. The request requires authentication, but the provided credentials are invalid or missing."
},
"422": {
"description": "The tool call is valid, but the parameters are invalid (missing, incorrect type, etc).",
"headers": {
"OXP-Version": {
"$ref": "#/components/headers/OXPServerHeader"
}
},
"content": {
"application/json": {
"schema": {
Expand All @@ -169,6 +179,25 @@
"bearerFormat": "JWT"
}
},
"parameters": {
"OXPVersionSelectorHeader": {
"name": "OXP-Version",
"in": "header",
"description": "Optional header to specify the version of the OXP protocol to use.",
"required": false,
"schema": {
"type": "string"
}
}
},
"headers": {
"OXPServerHeader": {
"description": "The OXP version used by the server",
"schema": {
"type": "string"
}
}
},
"schemas": {
"ToolId": {
"type": "string",
Expand Down