postgrest icon indicating copy to clipboard operation
postgrest copied to clipboard

OpenAPI is missing "This is a Primary key.<pk/>" description for views

Open wolfgangwalther opened this issue 3 years ago • 1 comments

This is happening on the latest pre-release and was introduced in d2719420f46a537a75d76a4666f8bffec582d4f8 / #2254.

PK columns have a description field in the OpenAPI output like this: This is a Primary key.<pk/>. This is still present for tables as tested here:

https://github.com/PostgREST/postgrest/blob/3e83bef9c4b1f105ad0f261d27f8c16eb9377776/test/spec/Feature/OpenApi/OpenApiSpec.hs#L125-L158

However after the above mentioned change this is now missing for views. The test-case demonstrated in ee906da99cd918e4940f9cc3d4570e526f71b851 is now failing but was passing before.

This breaks client libraries, which depend on <pk/>. For me that's https://github.com/technowledgy/vue-postgrest - and it blocks me from updating to the latest pre-release.

wolfgangwalther avatar Jul 05 '22 08:07 wolfgangwalther

As a workaround, PGRST_OPENAPI_MODE="ignore-privileges" detects the views PKs.

steve-chavez avatar Jul 05 '22 18:07 steve-chavez