Revert "add: configs as json GUC for db-root-spec"

This reverts commit f34ca15e84.
This commit is contained in:
steve-chavez
2026-08-04 00:50:18 -05:00
parent f34ca15e84
commit ca4a6d9e99
6 changed files with 32 additions and 94 deletions
+11 -15
View File
@@ -1866,22 +1866,18 @@ $$ language sql;
create or replace function root() returns "application/openapi+json" as $_$
declare
pgrst_config json := nullif(current_setting('request.root.configs', true), '')::json;
openapi json = $$
{
"swagger": "2.0",
"info":{
"title":"PostgREST API",
"description":"This is a dynamic API generated by PostgREST"
}
}
$$;
begin
return (
select json_build_object(
'swagger', '2.0',
'info', json_build_object(
'title', 'PostgREST API',
'description', 'This is a dynamic API generated by PostgREST'
),
'pgrst_server_host', pgrst_config->>'server_host',
'pgrst_server_port', pgrst_config->>'server_port',
'pgrst_openapi_server_proxy_uri', pgrst_config->>'openapi_server_proxy_uri',
'pgrst_db_schemas', pgrst_config->'db_schemas',
'pgrst_version', pgrst_config->>'version'
)::json);
end;
return openapi;
end
$_$ language plpgsql;
create or replace function welcome() returns "text/plain" as $$