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

Expose validator constraints to end-users using a new trait #318

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kyrias
Copy link
Contributor

@kyrias kyrias commented Apr 5, 2024

Re-implements #238 after the derive macro rewrite.

kyrias added 3 commits May 6, 2024 16:57
Signed-off-by: Johannes Löthberg <johannes.loethberg@elokon.com>
Signed-off-by: Johannes Löthberg <johannes.loethberg@elokon.com>
@kyrias kyrias force-pushed the constraints-trait3 branch from f78a594 to c405c2d Compare May 6, 2024 15:02
@kyrias
Copy link
Contributor Author

kyrias commented Jul 8, 2024

Ping.

@Keats
Copy link
Owner

Keats commented Jul 13, 2024

Thanks for the ping I had forgotten about it. I'll look at it next week.

Copy link
Owner

@Keats Keats left a 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>,
},
}
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants