Skip to content

integer($integer) is not a valid combination in openapi 2.0 #4641

@niklasskoldmark

Description

@niklasskoldmark

Environment

The Supabase local dev docker stack , but it seems to be a problem in the way postgrest generates the openapi spec

  • PostgreSQL version: 17.6.1.075
  • PostgREST version: v14.0
  • Operating system: MacOS

Description of issue

When I create a table with a column with the type int4 such as this:
create table "company" (
"company_id" int4 primary key
);

The generated openapi spec renders the definition like this:
"company": {
"required": [
"company_id"
],
"properties": {
"company_id": {
"description": "Note:\nThis is a Primary Key.",
"format": "integer",
"type": "integer"
}
},
"type": "object"
},

The format "integer" is not valid for the type "integer" in the 2.0 version of openapi, only "int32" and "int64" are valid formats for the type "integer"
See here: https://spec.openapis.org/oas/v2.0.html#data-types

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions