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

Add derive Deserialize to ValidationErrors #358

Closed
seanaye opened this issue Nov 11, 2024 · 3 comments · Fixed by #364
Closed

Add derive Deserialize to ValidationErrors #358

seanaye opened this issue Nov 11, 2024 · 3 comments · Fixed by #364

Comments

@seanaye
Copy link

seanaye commented Nov 11, 2024

The ValidationErrors type already implements Serialize, presumably to allow sending the error as json in an API. It would be helpful to allow implement Deserialize to read those errors back out on the client side in frontend frameworks like Leptos

@seanaye
Copy link
Author

seanaye commented Nov 11, 2024

Tried my hand at this and it looks like this is not possible without some pretty significant breaking changes due to the &'static lifetime

@Keats
Copy link
Owner

Keats commented Nov 21, 2024

It should probably be a Cow<static, str> like the rest

@ifiokjr
Copy link
Contributor

ifiokjr commented Dec 6, 2024

Had the same thought while using leptos.

ifiokjr added a commit to ifiokjr/validator that referenced this issue Jan 9, 2025
Use `Cow<'static, str>` as suggested in
Keats#358.
Keats pushed a commit that referenced this issue Jan 20, 2025
Use `Cow<'static, str>` as suggested in
#358.
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 a pull request may close this issue.

3 participants