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

Allow forwarding parameter attributes as Args fields attributes #7

Closed
swfsql opened this issue Oct 19, 2021 · 0 comments
Closed

Allow forwarding parameter attributes as Args fields attributes #7

swfsql opened this issue Oct 19, 2021 · 0 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@swfsql
Copy link

swfsql commented Oct 19, 2021

When an argument is generic (or is an associated type) that is bounded on serde::Deserialize (or serde::DeserializeOwned), the code generated by serde will add extra unnecessary bounds on specifically _serde::Deserialize<'de>, even when the type would already have bounds on eg. serde::DeserializeOwned.

As stated in their issue, serde-rs/serde#1296, one workaround is to attach some serde attributes that would prevent it from happening.

So for this, it should be possible to forward attributes to be attached to the fields on the Args structure definition. The best place for this is probably on the method parameters themselves.

@swfsql swfsql added bug Something isn't working enhancement New feature or request labels Oct 19, 2021
@swfsql swfsql self-assigned this Oct 19, 2021
@swfsql swfsql changed the title Allow forwarding parameter attributes as Args fields Allow forwarding parameter attributes as Args fields attributes Oct 19, 2021
@swfsql swfsql closed this as completed in f7558b7 Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant