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

Enhance parse error messages #16

Open
akheron opened this issue Mar 30, 2020 · 1 comment
Open

Enhance parse error messages #16

akheron opened this issue Mar 30, 2020 · 1 comment

Comments

@akheron
Copy link
Owner

akheron commented Mar 30, 2020

They're currently produced by io-ts's default reporter, and are very verbose and hard to decipher.

@akheron akheron changed the title Parse error messages are bad Enhance parse error messages Mar 30, 2020
@cdimitroulas
Copy link

cdimitroulas commented Aug 12, 2021

I guess it would be nice to have a couple of options for how the errors should be formatted. Some standard ones might be an array of strings for each key, or a single string for each key.

For example for a request body of type { name: string; age: number } you might get back a 400 response with { name?: string[]; age?: string[] } or { name?: string; age?: string } which are both nice and easy to handle as a client (and potentially even map directly to form fields in a UI)

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

2 participants