Skip to content

Commit

Permalink
update spec
Browse files Browse the repository at this point in the history
  • Loading branch information
rodber committed Oct 8, 2023
1 parent 2565473 commit 6a22e67
Showing 1 changed file with 97 additions and 65 deletions.
162 changes: 97 additions & 65 deletions api/spec.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Specification

xrDebug uses [Schwager](https://chevere.org/packages/schwager.html) for describing its HTTP API.
xrDebug uses [Schwager](https://chevere.org/packages/schwager.html) for describing its HTTP API. The [schwager.json](https://github.com/chevere/xrdebug/releases/latest/download/schwager.json) file is available since `1.0`.

* All parameters required except if `required: false`

```json
{
{
"api": "xr",
"name": "xrDebug API",
Expand All @@ -25,6 +26,9 @@ xrDebug uses [Schwager](https://chevere.org/packages/schwager.html) for describi
"200": [
{
"context": "SPAController",
"headers": [
"Content-Type: text\/html"
],
"body": {
"type": "string",
"regex": "^.*$\/m"
Expand All @@ -41,33 +45,38 @@ xrDebug uses [Schwager](https://chevere.org/packages/schwager.html) for describi
"endpoints": {
"POST": {
"description": "Create a debug message",
"body": {
"type": "array#map",
"parameters": {
"body": {
"required": false,
"type": "string",
"regex": ".*?"
},
"emote": {
"required": false,
"type": "string"
},
"file_line": {
"required": false,
"type": "string"
},
"file_path": {
"required": false,
"type": "string"
},
"id": {
"required": false,
"type": "string"
},
"topic": {
"required": false,
"type": "string"
"request": {
"headers": [
"Content-Type: application\/json"
],
"body": {
"type": "array#map",
"parameters": {
"body": {
"required": false,
"type": "string",
"regex": ".*?"
},
"emote": {
"required": false,
"type": "string"
},
"file_line": {
"required": false,
"type": "string"
},
"file_path": {
"required": false,
"type": "string"
},
"id": {
"required": false,
"type": "string"
},
"topic": {
"required": false,
"type": "string"
}
}
}
},
Expand All @@ -79,6 +88,11 @@ xrDebug uses [Schwager](https://chevere.org/packages/schwager.html) for describi
"type": "null"
}
}
],
"400": [
{
"context": "VerifySignatureMiddleware"
}
]
}
}
Expand All @@ -90,52 +104,62 @@ xrDebug uses [Schwager](https://chevere.org/packages/schwager.html) for describi
"endpoints": {
"POST": {
"description": "Create a pause",
"body": {
"type": "array#map",
"parameters": {
"id": {
"type": "string",
"regex": "^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$"
},
"body": {
"required": false,
"type": "string",
"regex": ".*?"
},
"emote": {
"required": false,
"type": "string"
},
"file_line": {
"required": false,
"type": "string"
},
"file_path": {
"required": false,
"type": "string"
},
"topic": {
"required": false,
"type": "string"
"request": {
"headers": [
"Content-Type: application\/json"
],
"body": {
"type": "array#map",
"parameters": {
"id": {
"type": "string",
"regex": "^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$"
},
"body": {
"required": false,
"type": "string",
"regex": ".*?"
},
"emote": {
"required": false,
"type": "string"
},
"file_line": {
"required": false,
"type": "string"
},
"file_path": {
"required": false,
"type": "string"
},
"topic": {
"required": false,
"type": "string"
}
}
}
},
"responses": {
"201": [
{
"context": "PausePostController",
"headers": [
"Content-Type: application\/json"
],
"body": {
"type": "array#map",
"parameters": {
"pause": {
"type": "boolean"
},
"stop": {
"type": "boolean"
}
}
}
}
],
"400": [
{
"context": "VerifySignatureMiddleware"
}
]
}
}
Expand All @@ -156,7 +180,10 @@ xrDebug uses [Schwager](https://chevere.org/packages/schwager.html) for describi
"responses": {
"204": [
{
"context": "PauseDeleteController"
"context": "PauseDeleteController",
"body": {
"type": "null"
}
}
],
"404": [
Expand All @@ -172,19 +199,24 @@ xrDebug uses [Schwager](https://chevere.org/packages/schwager.html) for describi
"200": [
{
"context": "PauseGetController",
"headers": [
"Content-Type: application\/json"
],
"body": {
"type": "array#map",
"parameters": {
"pause": {
"type": "boolean"
},
"stop": {
"type": "boolean"
}
}
}
}
],
"400": [
{
"context": "VerifySignatureMiddleware"
}
],
"404": [
{
"context": "PauseGetController"
Expand All @@ -198,12 +230,12 @@ xrDebug uses [Schwager](https://chevere.org/packages/schwager.html) for describi
"200": [
{
"context": "PausePatchController",
"headers": [
"Content-Type: application\/json"
],
"body": {
"type": "array#map",
"parameters": {
"pause": {
"type": "boolean"
},
"stop": {
"type": "boolean"
}
Expand Down

0 comments on commit 6a22e67

Please sign in to comment.