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

REST Handler requires id in the body while it already present on URL #1222

Closed
vgarmash opened this issue Apr 9, 2024 · 1 comment
Closed

Comments

@vgarmash
Copy link

vgarmash commented Apr 9, 2024

Description and expected behavior
It is confusing that we need to repeat the Id of the entity that we are updating by POST or PUT operations. I can provide one Id in URL and another in the body and the update is done to the object with Id in the Body while I assume the Id in the URL should be updated. . If I omit the id in the body, then I get error 404.

Screenshots
image

Environment (please complete the following information):

  • ZenStack version: 1.12.0
  • Prisma version: 5.12.1
  • Database type: Postgresql
@ymc9
Copy link
Member

ymc9 commented Apr 11, 2024

Hi @vgarmash , thanks for reporting this. I understand it feels redundant, but currently ZenStack's RESTful API follows the JSON:API specification: https://jsonapi.org/format/#crud-updating. The "id" field in the payload is required.

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

No branches or pull requests

2 participants