Skip to content

fix: preserve validation messages in tty output#127

Closed
gluckzhang wants to merge 1 commit intowevm:mainfrom
Firstset:validation-error-messages
Closed

fix: preserve validation messages in tty output#127
gluckzhang wants to merge 1 commit intowevm:mainfrom
Firstset:validation-error-messages

Conversation

@gluckzhang
Copy link
Copy Markdown
Contributor

This PR fixes misleading TTY validation output when a value is present but fails Zod validation. Previously, human-readable errors rewrote all field validation failures as missing arguments, so cases like --address abc with z.string().min(32) incorrectly rendered as missing required argument <address>.

The fix preserves structured Zod issue metadata in parser field errors and updates human formatting to distinguish true missing input from invalid values. Missing args still render as missing, while provided-but-invalid options and positionals now show the real validation message, such as invalid value for --address: Too small: expected string to have >=32 characters. Machine/JSON output remains compatible and continues to expose the underlying validation details.

Signed-off-by: Long Zhang <gluckzhang@gmail.com>
@tmm
Copy link
Copy Markdown
Member

tmm commented Apr 27, 2026

Closing in favor of #138

@tmm tmm closed this Apr 27, 2026
@gluckzhang gluckzhang deleted the validation-error-messages branch April 28, 2026 08:06
@gluckzhang
Copy link
Copy Markdown
Contributor Author

Thanks for taking care of this @tmm !

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