How to work with multiple schemas in PGRST_DB_SCHEMAS via Swagger UI? #2832
-
Greetings Just found out after some tests that Swagger UI connected to PostgREST always reads only the first schema from PGRST_DB_SCHEMAS list Is there a way to make Swagger look into all schemas from PGRST_DB_SCHEMAS? Or, alternatively, to add Content-Profile / Accept-Profile header as mandatory field to fill when forming request (defaulting to first / only schema from PGRST_DB_SCHEMAS)? I'm thinking about adding these headers manually with PGRST_DB_PRE_REQUEST function choosing necessary schema for a user with certain JWT token, but that's not ideal because one user can have multiple available schemas to use, so it would be better to choose it from UI somehow Environment
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi. Yes, this issue is currently open (#1547). The only way to get the OpenAPI spec for another schema is to add the curl "http://localhost:3000/" -H "Accept-Profile: <another-schema>" But still, the Swagger UI will not add the Accept-Profile for any of the paths as you noticed. For now, we're not making big updates to OpenAPI due to what's mentioned here #1698 (moving the OpenAPI implementation out of the core repo). |
Beta Was this translation helpful? Give feedback.
-
Thanks for clarification |
Beta Was this translation helpful? Give feedback.
Hi. Yes, this issue is currently open (#1547). The only way to get the OpenAPI spec for another schema is to add the
Accept-Profile: <another_schema>
in the request, e.g.:But still, the Swagger UI will not add the Accept-Profile for any of the paths as you noticed. For now, we're not making big updates to OpenAPI due to what's mentioned here #1698 (moving the OpenAPI implementation out of the core repo).