-
Notifications
You must be signed in to change notification settings - Fork 156
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
Expose validator constraints to end-users using a new trait #318
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Johannes Löthberg <johannes.loethberg@elokon.com>
Signed-off-by: Johannes Löthberg <johannes.loethberg@elokon.com>
Ping. |
Thanks for the ping I had forgotten about it. I'll look at it next week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit invasive and requires keeping the structs updated to match the parameters of the validators. Do we need the constraints to be fully typed? I'm guessing it's going to be passed to the frontend or some other service anyway in most cases
Can we somehow derive it from the darling attributes directly without having to add to the constraints on each function?
code: Option<Cow<'static, str>>, | ||
function: Cow<'static, str>, | ||
}, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need custom types VS a hashmap of all the args? We could build it in the derive macro
Re-implements #238 after the derive macro rewrite.