-
Notifications
You must be signed in to change notification settings - Fork 0
Swagger UI
Beau Barker edited this page Jul 24, 2025
·
11 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:
- postgrestAdd a route to serve Swagger UI:
caddy/Caddyfile
# Swagger UI
handle_path /openapi/\* {
reverse_proxy swagger-ui:8080
}
Once everything is running, open:
http://localhost:8000/openapi/
(Replace 8000 if you’re using a different CADDY_HTTP_PORT.)
You’ll now be able to browse and test your PostgREST endpoints directly in Swagger UI.
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.
You might want to configure the following setting in the postgres service
(see
PGRST_OPENAPI_MODE:
compose.yaml
PGRST_OPENAPI_MODE: ignore-privileges