Skip to content

Swagger: GET record from table with uuid primary key: failed to parse filter #1970

@artsra

Description

@artsra

Environment

  • PostgreSQL version: postgres:13
  • PostgREST version: postgrest/postgrest
  • Swagger image: swaggerapi/swagger-ui
  • Operating system: MacOS Big Sur 11.6

(Using this: https://github.com/johnnylambada/docker-postgrest-swagger-sample)

Description of issue

On swagger I try to GET a record from a table where the primary key is a UUID.
As a result I get:

{
  "details": "unexpected \"3\" expecting \"not\" or operator (eq, gt, ...)",
  "message": "\"failed to parse filter (3922488c-18bc-45d8-baa2-bdb10cd90e37)\" (line 1, column 1)"
}

I think this error originates from postgrest.

On the other hand if I try a filter like 'eq.3922488c-18bc-45d8-baa2-bdb10cd90e37' the action is refused by swagger, because the string with filter does not follow the uuid format.

How do I resolve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    OpenAPIenhancementa feature, ready for implementationhttphttp compliance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions