-
Notifications
You must be signed in to change notification settings - Fork 158
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
an attribute for skipping a struct field validation #182
Comments
Validation is only done if you are setting an attribute on the field so there would be nothing to skip? |
oh, but it gives me an error when i try to derive validation on a struct with use validator::Validate;
#[derive(Debug, Clone, Validate)]
pub struct Thing {
pub pos: [f32; 3],
} just checked with a fresh crate just in case. I get the following error with
|
Ah I see the issue. It should just ignore fields it doesn't recognize instead of erroring if there are no validators set on them. |
I'm having the same probleme here. Do you have a workaround or a solution? Maybe I can contribute. error: Type `[u8 ; 11]` of field `reserved` not supported
--> libcmd/src/lib.rs:88:19
|
88 | pub reserved: [u8; 11],
| ^^^^^^^^ |
No solutions yet, someone will need to go in the proc macro code, ctrl+F "not supported" and skip it instead of erroring if there are not validators set |
I would like to skip a struct field which is just a
[f32; 3]
and there's no validation to be performed. I was wondering if it is possible to have a attribute like#[serde(skip)]
which can skip validation for a particular struct field.eg:
#[validate(skip)]
The text was updated successfully, but these errors were encountered: