Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rodber committed Aug 30, 2023
1 parent e31ef61 commit 898396c
Show file tree
Hide file tree
Showing 5 changed files with 255 additions and 244 deletions.
245 changes: 2 additions & 243 deletions api/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# API
# HTTP API

xrDebug API standard defines a language-agnostic web service where any compatible client library can implement xr helpers in their own language/context.
xrDebug HTTP API standard defines a language-agnostic web service as variable introspection is generated on client-side.

Following examples use [curl](https://curl.se/) to issue HTTP requests to xrDebug API.

Expand Down Expand Up @@ -89,244 +89,3 @@ curl --fail -X POST \
-H "X-Signature: <signature>" \
http://127.0.0.1:27420/messages
```

## API specification

xrDebug uses [Schwager](https://chevere.org/packages/schwager.html) for describing the HTTP API standard.

* All parameters required except if `required: false`

```json
{
"api": "xr",
"name": "xrDebug API",
"version": "1.0.0",
"servers": [
{
"description": "xrDebug"
}
],
"paths": {
"\/": {
"name": "\/",
"regex": "\/",
"endpoints": {
"GET": {
"description": "Single page application",
"responses": {
"200": [
{
"context": "SPAController",
"body": {
"type": "string",
"regex": "^.*$\/m"
}
}
]
}
}
}
},
"\/messages": {
"name": "\/messages",
"regex": "\/messages",
"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"
}
}
},
"responses": {
"204": [
{
"context": "MessagePostController",
"body": {
"type": "null"
}
}
]
}
}
}
},
"\/pauses": {
"name": "\/pauses",
"regex": "\/pauses",
"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"
}
}
},
"responses": {
"201": [
{
"context": "PausePostController",
"body": {
"type": "array#map",
"parameters": {
"pause": {
"type": "boolean"
},
"stop": {
"type": "boolean"
}
}
}
}
]
}
}
}
},
"\/pauses\/{id}": {
"name": "\/pauses\/{id}",
"regex": "^(?|\/pauses\/([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}))$",
"variables": {
"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}$"
}
},
"endpoints": {
"DELETE": {
"description": "Delete a pause",
"responses": {
"204": [
{
"context": "PauseDeleteController"
}
],
"404": [
{
"context": "PauseDeleteController"
}
]
}
},
"GET": {
"description": "Get a pause",
"responses": {
"200": [
{
"context": "PauseGetController",
"body": {
"type": "array#map",
"parameters": {
"pause": {
"type": "boolean"
},
"stop": {
"type": "boolean"
}
}
}
}
],
"404": [
{
"context": "PauseGetController"
}
]
}
},
"PATCH": {
"description": "Update a pause to stop execution",
"responses": {
"200": [
{
"context": "PausePatchController",
"body": {
"type": "array#map",
"parameters": {
"pause": {
"type": "boolean"
},
"stop": {
"type": "boolean"
}
}
}
}
]
}
}
}
},
"\/stream": {
"name": "\/stream",
"regex": "\/stream",
"endpoints": {
"GET": {
"description": "Debug stream",
"responses": {
"200": [
{
"context": "StreamController",
"body": {
"type": "className",
"className": "React\\Stream\\ThroughStream"
}
}
]
}
}
}
}
}
}
```
6 changes: 6 additions & 0 deletions api/naming.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

return [
'README.md' => 'HTTP API',
'spec.md' => 'Specification',
];
6 changes: 6 additions & 0 deletions api/sorting.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

return [
'README.md',
'spec.md'
];
Loading

0 comments on commit 898396c

Please sign in to comment.