Replies: 1 comment
-
Garde does not handle parsing, validation is done on fully initialized types. It seems to me like you want to combine deserialization using https://github.com/jprochazk/garde/blob/main/integrations/axum_garde/src/with_validation.rs#L95-L101 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In my application I store IDs in the underlying form of i64. However, they are presented to the users in the surface form of string. Now, I won't be, obviously, getting any i64 forms from the outside, since the underlying form never leaves the system. The only way they can enter the system is through their surface form, which is string.
I want to be able to validate the format of the string, while still being able to use it as i64 using the newtype convention. This might not strictly be validation, but rather a combination of validation and parsing, but it is really useful for my application in terms of DX. I was wondering if there is a way to achieve this using Garde.
Many thanks \o/
Beta Was this translation helpful? Give feedback.
All reactions