Skip to content

Conversation

@bufdev
Copy link
Member

@bufdev bufdev commented Nov 25, 2025

Whenever you get a validation error, it reads like this:

validation errors:
 - foo: value must be greater than 0
 - bar: value must not contain "baz"

The "value" messaging is weird to me. It feels much more natural to have:

validation errors:
 - foo: must be greater than 0
 - bar: must not contain "baz"

I would even argue for:

validation errors:
 - "foo" must be greater than 0
 - "bar" must not contain "baz"

But that's a step too far for this simple PR.

@github-actions
Copy link

github-actions bot commented Nov 25, 2025

The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedNov 25, 2025, 7:20 PM

@timostamm
Copy link
Member

I agree that this results in a more natural error message.

However, that won't be the case when the message is shown next to an input field in a form. You wouldn't include the field path in the error message, and the error message needs to stand on it's own. This works for value must not contain "baz", but much less so for must not contain "baz" - it's not a full sentence.

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.

3 participants