Skip to content

Commit

Permalink
docs: update v3 schemas (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
morremeyer authored Nov 7, 2023
1 parent 8c70ac0 commit ef50389
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 6 deletions.
7 changes: 6 additions & 1 deletion content/en/docs/Reference/api/v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ This describes general behavior of all API endpoints

## JSON Schemas

This is a full list of all JSON schemas for the response bodies.
This is a list of all JSON schemas for request and response bodies.

As of now, these do **not** describe the schema for the resources themselves. This means that any property with any value will pass validation
for the different resources Envelope Zero knows, e.g. a Transaction.

However, these schemas can be used to validate that the general request or response format is implemented correctly.

{{< directoryindex path="/static/schemas/v3" pathURL="/schemas/v3" >}}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://envelope-zero.org/schemas/v3/get-collection.schema.json",
"$id": "https://envelope-zero.org/schemas/v3/get-collection.response.schema.json",
"title": "HTTP GET - Collection Endpoints",
"description": "The HTTP response body for GET collection endpoints",
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://envelope-zero.org/schemas/v3/get-patch-resource.schema.json",
"$id": "https://envelope-zero.org/schemas/v3/get-patch-resource.response.schema.json",
"title": "HTTP GET/PATCH - Resource Endpoint",
"description": "The HTTP response body for GET/PATCH resource endpoints",
"type": "object",
Expand Down
7 changes: 7 additions & 0 deletions static/schemas/v3/patch.request.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://envelope-zero.org/schemas/v3/patch.request.schema.json",
"title": "HTTP PATCH request",
"description": "The HTTP request body for PATCH requests",
"type": "object"
}
11 changes: 11 additions & 0 deletions static/schemas/v3/post.request.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://envelope-zero.org/schemas/v3/post.request.schema.json",
"title": "HTTP POST request",
"description": "The HTTP request body for POST requests",
"type": "array",
"minLength": 1,
"items": {
"type": "object"
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://envelope-zero.org/schemas/v3/get-collection.schema.json",
"title": "HTTP GET - Collection Endpoints",
"description": "The HTTP response body for GET collection endpoints",
"$id": "https://envelope-zero.org/schemas/v3/post.response.schema.json",
"title": "HTTP POST response",
"description": "The HTTP response body for POST requests",
"type": "object",
"required": ["data", "error"],
"properties": {
Expand Down

0 comments on commit ef50389

Please sign in to comment.