Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Row Filter parameter format is displayed as integer #3504

Open
dantheman2865 opened this issue May 10, 2024 · 0 comments
Open

Row Filter parameter format is displayed as integer #3504

dantheman2865 opened this issue May 10, 2024 · 0 comments
Labels

Comments

@dantheman2865
Copy link

dantheman2865 commented May 10, 2024

Hello, I've been using the OpenAPI spec in tandem with a code generator for Typescript files. I have found that the rowFilter parameters are generating incorrectly. For a table like:

CREATE TABLE IF NOT EXISTS api.providers
(
    id integer NOT NULL DEFAULT nextval('api.providers_id_seq'::regclass),
    name character varying(256) COLLATE pg_catalog."default" NOT NULL,
    active boolean NOT NULL DEFAULT true,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    CONSTRAINT providers_pkey PRIMARY KEY (id)
)

It makes sense that definitions.providers.properties.id is:

{
    "description": "Note:\nThis is a Primary Key.<pk/>",
    "format": "integer",
    "type": "integer"
},

HOWEVER, the definition for rowFilter is wrong:

"rowFilter.providers.id": {
    "name": "id",
    "required": false,
 -->"format": "integer",<--
    "in": "query",
    "type": "string"
},

Because, the query syntax for filtering is id=eq.<number>, NOT id=<number>.

I believe it should omit the format field as below:

"rowFilter.providers.id": {
    "name": "id",
    "required": false,
    "in": "query",
    "type": "string"
},

Thanks!

@dantheman2865 dantheman2865 changed the title Row Filter parameter type is displayed as integer Row Filter parameter format is displayed as integer May 10, 2024
@laurenceisla laurenceisla transferred this issue from PostgREST/postgrest-openapi May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants