zenstackhq / zenstack

Fullstack TypeScript toolkit that enhances Prisma ORM with flexible Authorization layer for RBAC/ABAC/PBAC/ReBAC, offering auto-generated type-safe APIs and frontend hooks.
https://zenstack.dev
MIT License
2.07k stars 88 forks source link

Autogenerated CRUD API should omit Id fields for adding new entities by POST #736

Closed vbg8exadel closed 12 months ago

vbg8exadel commented 1 year ago

Description and expected behavior I used to use Spring Data Rest which does generate the CRUD API out of managed entity classes. They correctly omit Id fields from POST operations where we add new entity to the DB. The Id is autogenerated either by DB or by the framework code. Therefore, the API should not ask for the Id to be provided as part of the request.

Screenshots Here is a typical example: image

Environment (please complete the following information):

Additional context Even though the Id marked as required in the Open API, actual POST /entity doesn't fail for request without Id, which is correct.

ymc9 commented 1 year ago

Thanks for filing this @vbg8exadel ! I'm marking it to be fixed in V1.1

ymc9 commented 12 months ago

Fixed in v1.1.0.