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 clarity around required/ignore documentation #230

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions docs/migrate.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,17 @@ standard constraints between `protoc-gen-validate` and `protovalidate`:
- All field-level constraints have moved into a single
option: `(buf.validate.field)`.

- **`(validate.rules).<TYPE>.required`**: moved
to `(buf.validate.field).required`.
- **`(validate.rules).<TYPE>.required`**: moved to
`(buf.validate.field).required`. The semantics of required have changed and
been clarified. Please consult the [documentation][validate] to ensure they
match expectations compared to its behavior in PGV.

- **`(validate.rules).message.skip`**: moved to `(buf.validate.field).skipped`.

- **`(validate.rules).<TYPE>.ignore_empty`**: moved
to `(buf.validate.field).ignore_empty`.
to `(buf.validate.field).ignore_empty`. `ignore_empty` has also been
deprecated in favor of the new, more powerful `ignore` enum. Please consult
the [documentation][ignore] to see which semantics match expectations.

- **`(validate.rules).map.no_sparse`**: removed. The original rule accommodated
for a situation that was only possible in the Go code generation exclusively.
Expand Down Expand Up @@ -153,3 +157,5 @@ manual migration:

[go-legacy]: https://github.com/bufbuild/protovalidate-go/README.md#support-legacy-protoc-gen-validate-constraints
[format]: https://buf.build/docs/format/style/
[validate]: https://buf.build/bufbuild/protovalidate/docs/main:buf.validate#buf.validate.FieldConstraints
[ignore]: https://buf.build/bufbuild/protovalidate/docs/main:buf.validate#buf.validate.Ignore