feat(httpapi): the API is described by an OpenAPI document generated with Huma (#2028)
Every /api operation is registered with Huma behind one admin-token middleware, served at /api/openapi.json with a docs page at /api/docs, and committed as api/openapi.yaml, which task check keeps current.
This commit is contained in:
32 files changed
+4467
-1105
No files matched your search
@@ -64,6 +64,18 @@ tasks:
|
||||
- task: db:generate
|
||||
- git diff --exit-code -- internal/infrastructure/postgres/postgresdb
|
||||
|
||||
openapi:generate:
|
||||
desc: Write the API's OpenAPI document to api/openapi.yaml
|
||||
cmds:
|
||||
- mkdir -p api
|
||||
- go run ./cmd/archie openapi > api/openapi.yaml
|
||||
|
||||
openapi:check:
|
||||
desc: Regenerate the OpenAPI document and reject uncommitted differences
|
||||
cmds:
|
||||
- task: openapi:generate
|
||||
- git diff --exit-code -- api/openapi.yaml
|
||||
|
||||
proto:check:
|
||||
desc: Regenerate contracts and reject uncommitted generated differences
|
||||
cmds:
|
||||
@@ -311,6 +323,7 @@ tasks:
|
||||
- task: fmt
|
||||
- task: proto:check
|
||||
- task: db:check
|
||||
- task: openapi:check
|
||||
- task: check:readonly
|
||||
|
||||
check:readonly:
|
||||
|
||||
Reference in new issue
Block a user