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

RESTAPIHandler should return all ids as strings #1908

Open
thomassnielsen opened this issue Dec 5, 2024 · 4 comments
Open

RESTAPIHandler should return all ids as strings #1908

thomassnielsen opened this issue Dec 5, 2024 · 4 comments
Milestone

Comments

@thomassnielsen
Copy link
Contributor

Description and expected behavior
The RESTAPIHandler returns ids as whatever the type is in the db. But json:api requires ids to be strings. The OpenAPI plugin correctly requires ids to be strings, creating a mismatch between the docs and the implementation.

Environment:

  • ZenStack version: 2.9.4
  • Prisma version: 5.22.0
  • Database type: Postgresql
@ymc9 ymc9 modified the milestones: v2.10.x, v2.11.0 Dec 10, 2024
@ymc9
Copy link
Member

ymc9 commented Dec 30, 2024

Hi @thomassnielsen , thanks, I see the inconsistency. Changing the RESTAPIHandler will result in a breaking change. For the time being, how about changing the openapi plugin to generate id field type as defined in the schema? It'll deviate from the JSON:API spec, but we can document that.

@thomassnielsen
Copy link
Contributor Author

That sounds good to me.

@thomassnielsen
Copy link
Contributor Author

We could also add a note in the docs that if full JSON:API spec compliance is important, one can use strings as ids in the schema.

@ymc9
Copy link
Member

ymc9 commented Dec 30, 2024

Sounds good. Thank you!

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

No branches or pull requests

2 participants