Skip to content
Merged
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
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ SDK code examples for each supported language, organized by version, platform, a
| Version | Specs | Examples |
|---------|-------|----------|
| latest | [specs/latest](specs/latest) | - |
| 2.2.x | [specs/2.2.x](specs/2.2.x) | [examples/2.2.x](examples/2.2.x) |
| 2.1.x | [specs/2.1.x](specs/2.1.x) | [examples/2.1.x](examples/2.1.x) |
| 2.0.x | [specs/2.0.x](specs/2.0.x) | [examples/2.0.x](examples/2.0.x) |
| 1.9.x | [specs/1.9.x](specs/1.9.x) | [examples/1.9.x](examples/1.9.x) |
| 1.8.x | [specs/1.8.x](specs/1.8.x) | [examples/1.8.x](examples/1.8.x) |
| 1.7.x | [specs/1.7.x](specs/1.7.x) | [examples/1.7.x](examples/1.7.x) |
Expand Down Expand Up @@ -67,17 +70,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/2.0.x/open-api3-2.0.x.json
curl -O https://raw.githubusercontent.com/appwrite/specs/main/specs/2.2.x/open-api3-2.2.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
' open-api3-2.2.x.json > open-api3-2.2.x-server.json

# Generate a client
openapi-generator generate -i open-api3-2.0.x-server.json -g python -o ./sdk
openapi-generator generate -i open-api3-2.2.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 All @@ -88,13 +91,15 @@ Each example file is a Markdown document showing how to call a specific API meth

## How Specs Are Generated

Specs and examples are automatically generated from the [appwrite/appwrite](https://github.com/appwrite/appwrite) repository using the `specs` CLI task:
Specs and examples are generated from the [appwrite/appwrite](https://github.com/appwrite/appwrite) codebase using the `specs` CLI task:

```bash
php app/cli.php specs --version=1.9.x --git=yes --message="Update specs for 1.9.x"
php app/cli.php specs --version=2.2.x --git=yes --message="Update specs for 2.2.x"
```

This generates the API specification files, regenerates SDK examples for all supported languages, and creates a PR in this repository.
The task writes the API specification for that version, regenerates SDK examples for every supported language, and opens a PR in this repository. Releases run it through Appwrite's deployment automation rather than by hand, which is why the PRs here are authored by a bot.

Each version is generated from the code that shipped it, so a document keeps the vendor extensions of its own release. `x-appwrite.config` on an operation, for example, appears from 2.2.x onwards; earlier versions state the same binding with a `ProjectPath` security scheme.

## Contributing

Expand Down
Loading