How to add or modify endpoints in the OutLayer API spec.
- Node 18+
git- Understanding of OpenAPI 3.1 + JSON Schema 2020-12 (most YAML in
openapi.yamlis self-explanatory; ask in PR if unsure)
git clone https://github.com/out-layer/api-spec
cd api-spec
npm install-
Confirm the endpoint exists in the coordinator. The spec describes reality, not aspiration. If you're proposing a new endpoint, that's a separate conversation — open an issue on the coordinator repo first.
-
Add the path entry to
openapi.yamlunderpaths:. Pick a tag (Wallet, Policy, Approvals, Audit, Requests, Meta) and write a one-linesummary+ multi-linedescription(Markdown ok). -
Add an
operationIdin camelCase. This becomes the method name in generated SDKs. Pick something idiomatic (intentsWithdraw, notWALLET_V1_INTENTS_WITHDRAW_POST). -
Reference shared response components for errors:
'400': { $ref: '#/components/responses/BadRequest' } '401': { $ref: '#/components/responses/Unauthorized' }
Don't redefine error responses inline — use the shared
components/responses/*aliases. -
Define new schemas in
components/schemas/, not inline. Inline schemas don't generate clean SDK types. Reference them with$ref. -
Add at least one
examplefor request bodies and success responses. Examples become code samples in Scalar UI. -
Run validation:
npm run lint # must report "Your API description is valid" with 0 warnings npm run types # must produce a clean dist/types.ts
-
Update docs/coverage.md if the endpoint is in a new area.
-
Update CHANGELOG.md under
[Unreleased]. -
Open a PR with:
- The endpoint(s) added
- The motivating use case (1–2 sentences)
- Link to the coordinator PR or issue that implemented it
The bar is higher: existing clients depend on the current shape.
| Change | Backward-compatible? | Version bump |
|---|---|---|
| Add optional request field | ✅ | minor |
| Add response field | ✅ | minor |
| Tighten description / add example | ✅ | patch |
Add response enum value |
✅ (consumers tolerate unknown) | minor |
| Remove field | ❌ | major (post-1.0: deprecation cycle first) |
| Rename field | ❌ | major |
| Change field type | ❌ | major |
| Move auth from header to body | ❌ | major |
For breaking changes pre-1.0, batch them in a next branch and ship together as 0.X+1.0.
- YAML: 2-space indent, no tabs.
redocly format openapi.yamlnot required but consistent. snake_caseon the wire,camelCaseforoperationId. The wire format matches the Rust handlers; SDKs convert per-language convention if they want.- Descriptions are GitHub-flavored Markdown. Cross-link with
[link text](path). - One example per request body, more for endpoints with mode variations (e.g.,
registerhas anonymous and bound-to-account modes).
- Use existing endpoints as templates.
POST /wallet/v1/intents/withdrawis a good reference for a write op with idempotency + multisig. - Keep schemas flat. Deeply-nested response types are hard to consume in non-TS languages.
- Ask in the PR. Spec design is part of the API contract — bikeshedding here saves real pain later.