-
Notifications
You must be signed in to change notification settings - Fork 0
Swagger UI
Beau Barker edited this page Jul 24, 2025
·
9 revisions
Swagger UI lets users visually explore and interact with your API.
Add a new service:
compose.yaml
swagger-ui:
image: swaggerapi/swagger-ui:v5.20.1
environment:
SWAGGER_JSON_URL: http://localhost:${CADDY_HTTP_PORT:?}/rest/
depends_on:
- postgrest
Add a route to serve Swagger UI:
caddy/Caddyfile
# Swagger UI
handle_path /openapi/\* {
reverse_proxy swagger-ui:8080
}
Restart Caddy, then open:
http://localhost:8000/openapi/
(Assuming 8000 is your Caddy port.)
PostgREST exposes its OpenAPI spec, but it only documents the "default schema", which is public
by
default, or the first schema listed in PGRST_DB_SCHEMAS
. To see everything, you might want to set PGRST_OPENAPI_MODE in the postgres
service:
compose.yaml
PGRST_OPENAPI_MODE: ignore-privileges