The API is described by an OpenAPI 3.0 specification. The server loads the spec from file instead of generating it from code (Option A: single source of truth).
- Canonical (shared): OSM-Notes-Common at
schemas/openapi/notes-api-v1.yaml. Use this for client generation, validation, or documentation shared across the ecosystem. - This repo: OSM-Notes-Common is added as a git submodule at
lib/osm-common. The app loads the spec fromlib/osm-common/schemas/openapi/notes-api-v1.yamlwhen present; otherwise it falls back to the local copy atopenapi/notes-api-v1.yaml.
On startup, the app resolves the spec path in this order:
OPENAPI_SPEC_PATH(env): absolute or relative path to the YAML/JSON file.- OSM-Notes-Common submodule:
lib/osm-common/schemas/openapi/notes-api-v1.yamlif the submodule is added. - Local:
openapi/notes-api-v1.yamlin the project root.
So you can run without Common by keeping the local openapi/notes-api-v1.yaml, or point to Common via the submodule or OPENAPI_SPEC_PATH.
Standard URLs (no User-Agent required):
| URL | Description |
|---|---|
GET /docs |
Swagger UI (interactive docs). |
GET /docs/json |
OpenAPI spec as JSON (same as below). |
GET /openapi.json |
OpenAPI spec as JSON (common convention). |
GET /swagger.json |
OpenAPI spec as JSON (common convention). |
Examples: https://notes-api.osm.lat/docs, https://notes-api.osm.lat/openapi.json, https://notes-api.osm.lat/swagger.json.
The Common repo is included as a submodule at lib/osm-common. The spec is at lib/osm-common/schemas/openapi/notes-api-v1.yaml.
To push the spec to the Common repo (first time or after editing the local copy):
cd lib/osm-common
git add schemas/openapi/notes-api-v1.yaml
git commit -m "Add or update OpenAPI spec for OSM-Notes-API"
git push
cd ../..
git add lib/osm-common
git commit -m "Update osm-common submodule (OpenAPI spec)"To clone this repo with the submodule:
git clone --recurse-submodules https://github.com/OSM-Notes/OSM-Notes-API.git
# or after a plain clone:
git submodule update --initWhen you add or change endpoints or schemas, edit lib/osm-common/schemas/openapi/notes-api-v1.yaml (or the local openapi/notes-api-v1.yaml and then copy it into the submodule), then commit and push in Common so the canonical spec stays in sync.