You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to manage API versions by using a unique schema but prefixing version in my table names like "v1/mytable"
CREATE TABLE my_schema."v1/my_endpoint_table" (
id serial4 NOT NULL, -- unique identifier
uuid varchar NOT NULL, -- natural key
label varchar NULL, -- label
CONSTRAINT my_endpoint_table_pk PRIMARY KEY (id),
CONSTRAINT my_endpoint_table_unique UNIQUE (uuid)
);
COMMENT ON TABLE "v1/my_endpoint_table" IS 'My table';
This throw no errors in Postgres Side, neither in PostGREST or swagger but after taking a look closer as soon as you expand the Swagger Ui section, Swagger show errors at the begining of the web page
Errors
Resolver error at paths./v1/my_endpoint_table.get.parameters.0.$ref
Could not resolve reference: Could not resolve pointer: /parameters/rowFilter.v1/my_endpoint_table.id does not exist in document
The same for each table column
I found that some information is missing too by comparing both swagger Ui file with or without "/" in table name just by renaming mytable and restartint swagger ui container
all "summary" fileds in JSON "path"/"get"|"post"|"delete"|"patch" sections are missing in the swagger Ui difinition of the table with "/" in its name
As soon as Postgres allow table name with "/", PostgRest should manage it correctly
The text was updated successfully, but these errors were encountered:
Ah, that's a nice observation, which I consider a feature (for us, nonetheless), not a bug.
This is because when we know / can't be used properly in names right now, we are not going to break existing setups when we do something similar to #1086 or #2166.
version management could be a very nice feature, by allowing/managing table names with '/' is it is question here or via another way to customize url in some way.
And if done something on that, maybe try all kind of version syntax or all caracters allowed by postgresql schema/table names
v1
v1.0
v1.0~build
v1.0#patch
and so on with all special caracters $%^<>...
Environment
Description of issue
I was trying to manage API versions by using a unique schema but prefixing version in my table names like "v1/mytable"
This throw no errors in Postgres Side, neither in PostGREST or swagger but after taking a look closer as soon as you expand the Swagger Ui section, Swagger show errors at the begining of the web page
The same for each table column
I found that some information is missing too by comparing both swagger Ui file with or without "/" in table name just by renaming mytable and restartint swagger ui container
As soon as Postgres allow table name with "/", PostgRest should manage it correctly
The text was updated successfully, but these errors were encountered: