sea-orm icon indicating copy to clipboard operation
sea-orm copied to clipboard

Add sea-orm-cli flag to skip deserialization of primary keys for entities

Open Witcher01 opened this issue 2 years ago • 1 comments

Motivation

Expecting a JSON value with a web framework usually makes it return the correct status codes etc. if an entity cannot be deserialized from the request, but currently this is hard to do as the entities by default required the primary key to be present in the JSON, which is not what a POST request tends to accept.

Proposed Solutions

Add a flag to sea-orm-cli that enables #[serde(skip_deserializing)] for primary keys of entities.

Witcher01 avatar Jul 06 '22 08:07 Witcher01

I'd love to work on this, but I'm not sure when that will be. If someone else wants to implement this, feel free to do so.

Since I'm a first time contributor to sea-orm I'd love some hints where this would roughly be implemented and what to look out for, if anything.

Witcher01 avatar Jul 06 '22 08:07 Witcher01