Skip to content
Merged
Show file tree
Hide file tree
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
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ This repository contains the official [Appwrite](https://appwrite.io) API specif
```
specs/
{version}/
swagger2-{version}-{platform}.json
open-api3-{version}-{platform}.json
open-api3-{version}.json # 2.0.x and later: one document, all platforms
open-api3-{version}-{platform}.json # up to 1.9.x
swagger2-{version}-{platform}.json # up to 1.8.x
examples/
{version}/
{platform}-{sdk}/
Expand All @@ -22,7 +23,7 @@ examples/

### Specs

API specification files in [Swagger 2.0](https://swagger.io/specification/v2/) and [OpenAPI 3.0](https://swagger.io/specification/) formats, organized by version and platform:
API specification files in [Swagger 2.0](https://swagger.io/specification/v2/) and [OpenAPI 3.0](https://swagger.io/specification/) formats, organized by version. From 2.0.x there is one OpenAPI 3 document per version; each operation, method alias and security scheme lists the SDK platforms it is available on under `x-appwrite.platforms`. Older versions ship one document per platform:

- **client** - Client-side APIs (web, mobile)
- **server** - Server-side APIs (backend SDKs)
Expand Down Expand Up @@ -66,10 +67,17 @@ You can use these specs with any OpenAPI-compatible tool. For example, to genera

```bash
# Download the spec
curl -O https://raw.githubusercontent.com/appwrite/specs/main/specs/1.9.x/open-api3-1.9.x-server.json
curl -O https://raw.githubusercontent.com/appwrite/specs/main/specs/2.0.x/open-api3-2.0.x.json

# The document covers every platform. Keep the operations available to one of
# them (client, server or console) by filtering on x-appwrite.platforms.
jq --arg platform server '
.paths |= (map_values(with_entries(select(.value["x-appwrite"].platforms | index($platform))))
| with_entries(select(.value | length > 0)))
' open-api3-2.0.x.json > open-api3-2.0.x-server.json

# Generate a client
openapi-generator generate -i open-api3-1.9.x-server.json -g python -o ./sdk
openapi-generator generate -i open-api3-2.0.x-server.json -g python -o ./sdk
```

Or import directly into tools like [Postman](https://www.postman.com/), [Insomnia](https://insomnia.rest/), or [Swagger UI](https://swagger.io/tools/swagger-ui/).
Expand Down
Loading