-
Notifications
You must be signed in to change notification settings - Fork 0
Swagger UI
Beau Barker edited this page Oct 11, 2025
·
11 revisions
Swagger UI lets users visually explore and interact with your API.
Add a new service:
app/compose.yaml
swagger-ui:
image: swaggerapi/swagger-ui:v5.20.1
environment:
SWAGGER_JSON_URL: http://localhost:${CADDY_HTTP_PORT:?}/rest/
depends_on:
- postgrestAdd a route to serve Swagger UI:
app/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:
app/compose.yaml
PGRST_OPENAPI_MODE: ignore-privileges