-
-
Notifications
You must be signed in to change notification settings - Fork 521
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
Add sea-orm-cli flag to skip deserialization of primary keys for entities #841
Milestone
Comments
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
added a commit
to Witcher01/sea-orm
that referenced
this issue
Jul 6, 2022
1 task
This was referenced Nov 3, 2022
2 tasks
billy1624
pushed a commit
that referenced
this issue
Dec 19, 2022
* Add CLI option to skip primary keys with serde Implements: #841 * Codegen: fix tests * complete skip_deserialize cli feature * run fmt * fix tests Co-authored-by: witcher <[email protected]>
billy1624
added a commit
that referenced
this issue
Dec 19, 2022
* Cli serde skip deserialize for primary key option (#1186) * Add CLI option to skip primary keys with serde Implements: #841 * Codegen: fix tests * complete skip_deserialize cli feature * run fmt * fix tests Co-authored-by: witcher <[email protected]> * [cli] should be `#[serde(skip_deserializing)]` * [CLI] code refactor * [cli] rename Co-authored-by: Isaiah Gamble <[email protected]> Co-authored-by: witcher <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.The text was updated successfully, but these errors were encountered: