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
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
First of all @iri thanks so much for adding a postgres schema generator!
Here's my issue:
When trying to generate a database schema using postgresql-schema, the datatype for referenced ($ref) schemas is not recognised correctly.
Generating using a Makefile that starts the generator in a docker container.
Steps to reproduce
In the example below I'm showing two properties, geotag and exif both of which should be JSON dataypes. exif is defined in place and correctly assigned the JSON datatype whereas geotag uses a $ref to the schema further down in the screenshot but ends up being classed as TEXT.
Looking at the log, it seems like because the type is detected to be the name of the referenced model it falls back to the default which is TEXT:
Bug Report Checklist
Description
First of all @iri thanks so much for adding a postgres schema generator!
Here's my issue:
When trying to generate a database schema using postgresql-schema, the datatype for referenced (
$ref
) schemas is not recognised correctly.openapi-generator version
:latest
docker image as of today.OpenAPI declaration file content or url
Full file here.
Generation Details
Generating using a Makefile that starts the generator in a docker container.
Steps to reproduce
In the example below I'm showing two properties,
geotag
andexif
both of which should be JSON dataypes.exif
is defined in place and correctly assigned the JSON datatype whereasgeotag
uses a$ref
to the schema further down in the screenshot but ends up being classed asTEXT
.Looking at the log, it seems like because the type is detected to be the name of the referenced model it falls back to the default which is
TEXT
:Related issues/PRs
Couldn't find any.
Suggest a fix
Digging through the generator code it looked like it required a
type
property but of course it being a$ref
that's not allowed and called out by the validator:I also tried to use the mysql-schema generator which suffers from the same issue.
The suggested fix would be I guess to check referenced schemas for their datatype instead of only relying on a
type
property in place.The text was updated successfully, but these errors were encountered: