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

Selectable's check_for_backend ignores deserialize_as attribute #3719

Closed
Ten0 opened this issue Jul 28, 2023 · 2 comments
Closed

Selectable's check_for_backend ignores deserialize_as attribute #3719

Ten0 opened this issue Jul 28, 2023 · 2 comments

Comments

@Ten0
Copy link
Member

Ten0 commented Jul 28, 2023

This causes it to generate a _check_field_compatibility that verifies that the final target type matches the schema, instead of the type it will actually be deserialized in, causing unnecessary compilation errors until check_for_backend is disabled.

@Ten0 Ten0 added the bug label Jul 28, 2023
@weiznich
Copy link
Member

Yes that's a bug in this code:

let field_ty = to_field_ty_bound(&f.ty);

We need to call ty_for_deserialize() there instead of directly using f.ty.

weiznich added a commit to weiznich/diesel that referenced this issue Jul 31, 2023
Add support for `#[diesel(deserialize_as = …)]` to
`#[diesel(check_for_backend())]` by using the correct deserialization type.
github-merge-queue bot pushed a commit that referenced this issue Jul 31, 2023
@weiznich
Copy link
Member

Closed by #3721

weiznich added a commit to weiznich/diesel that referenced this issue Aug 18, 2023
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