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

Improve reitit malli humanize data so you can map the errors back to the submitted data. #670

Open
juniper-oly opened this issue Apr 4, 2024 · 0 comments

Comments

@juniper-oly
Copy link

Currently when ring returns a response containing humanize it does not tell you the corresponding spec/key that failed, ideally you would want to be able to map back to the input data.

Example being a spec which is being validated in html form when submitted would get a response but there seems to ne know way to know which field in the form had the error so deciding which field should have an error marked against it is difficult.

This would be nice to be built in, or at least allow it to be overriden so custom functionality could be added, seem this would be nicer to be built in as reitit is all about routing http requests so not sure why you might not want this available, adding it in though would likely cause breaking changes.

This is an example response, I submitted 2 fields user and password but I can't find a way to map the error back to those fields, discussed with @ikitommi suggested this would be looked at so I am creating this issue as a reminder.

"humanized":["invalid type","invalid type"]

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

No branches or pull requests

1 participant