Skip to content

Conversation

@jasonchoimtt
Copy link

Hello! First of all, thank you for developing this library.

When using this library with SQLite, I found a issue where the generated OpenAPI schema specifies id as a string when it should be number. After digging into Payload's source code, it seems that the id field type should be determined by the DB adapter by default, e.g.:
https://github.com/payloadcms/payload/blob/main/packages/payload/src/bin/generateTypes.ts#L32

This PR updates the relevant calls to entityToJSONSchema to use config.db.defaultIDType as the default ID type, which corrects the type of id fields. I have also added a test case using the sqlite adapter to demonstrate this.

Thanks for your time to review this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant