Skip to content

Commit 2149325

Browse files
docs: Audit HTTP API docs against code (#4569)
Audited all registered routes in `database.rs` and `identity.rs` against the HTTP API documentation. ## Fixes **database.md:** - `/v1/database/:name_or_identity` publish: `POST` → `PUT` (code has `db_put: put(publish::<S>)`) - `DELETE` row in summary table: anchor pointed to POST section instead of DELETE section - Typo: `Updgrade` → `Upgrade` in WebSocket subscribe headers **identity.md:** - Removed `POST /v1/identity/:identity/set-email` — documented but has no handler registered in `IdentityRoutes` (dead documentation) ## Routes in code but intentionally not documented (internal/unstable) - `POST /v1/database/:noi/pre_publish` - `PUT /v1/database/:noi/reset` - `GET /v1/database/:noi/unstable/timestamp` These are used internally by the CLI and are not part of the public API. --------- Signed-off-by: Zeke Foppa <196249+bfops@users.noreply.github.com> Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com> Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
1 parent 41ab8f3 commit 2149325

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

docs/docs/00300-resources/00200-reference/00200-http-api/00300-database.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ The HTTP endpoints in `/v1/database` allow clients to interact with Spacetime da
1111
| Route | Description |
1212
| -------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
1313
| [`POST /v1/database`](#post-v1database) | Publish a new database given its module code. |
14-
| [`POST /v1/database/:name_or_identity`](#post-v1databasename_or_identity) | Publish to a database given its module code. |
14+
| [`PUT /v1/database/:name_or_identity`](#put-v1databasename_or_identity) | Publish to a database given its module code. |
1515
| [`GET /v1/database/:name_or_identity`](#get-v1databasename_or_identity) | Get a JSON description of a database. |
16-
| [`DELETE /v1/database/:name_or_identity`](#post-v1databasename_or_identity) | Delete a database. |
16+
| [`DELETE /v1/database/:name_or_identity`](#delete-v1databasename_or_identity) | Delete a database. |
1717
| [`GET /v1/database/:name_or_identity/names`](#get-v1databasename_or_identitynames) | Get the names this database can be identified by. |
1818
| [`POST /v1/database/:name_or_identity/names`](#post-v1databasename_or_identitynames) | Add a new name for this database. |
1919
| [`PUT /v1/database/:name_or_identity/names`](#put-v1databasename_or_identitynames) | Set the list of names for this database. |
@@ -51,9 +51,9 @@ If the database was successfully published, returns JSON in the form:
5151
} }
5252
```
5353

54-
## `POST /v1/database/:name_or_identity`
54+
## `PUT /v1/database/:name_or_identity`
5555

56-
Publish to a database with the specified name or identity. If the name doesn't exist, creates a new database.
56+
Publish to a database with the specified name or identity. If the name does not exist, creates a new database.
5757

5858
Accessible through the CLI as `spacetime publish`.
5959

@@ -223,7 +223,7 @@ For more information about WebSocket headers, see [RFC 6455](https://datatracker
223223
| Name | Value |
224224
| ------------------------ | --------------------------------------------------------------------- |
225225
| `Sec-WebSocket-Protocol` | `v1.bsatn.spacetimedb` or `v1.json.spacetimedb` |
226-
| `Connection` | `Updgrade` |
226+
| `Connection` | `Upgrade` |
227227
| `Upgrade` | `websocket` |
228228
| `Sec-WebSocket-Version` | `13` |
229229
| `Sec-WebSocket-Key` | A 16-byte value, generated randomly by the client, encoded as Base64. |

0 commit comments

Comments
 (0)