Skip to content

Commit

Permalink
Merge branch 'osun/lint-examples' of https://github.com/bufbuild/buf
Browse files Browse the repository at this point in the history
…into osun/lint-examples
  • Loading branch information
bufdev committed Oct 3, 2024
2 parents 02d8762 + 4f73316 commit a053f42
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -767,9 +767,10 @@ func checkExampleValues(
exampleValues []protoreflect.Value,
extensionTypeResolver protoencoding.Resolver,
) error {
// We need to reparse the extensions here to ensure that we are capturing constraints from
// predefined rules that may be from imported files here. This is to ensure that example
// values adhere to all constraints.
// A rule on this field may be from a predefined rule from an imported file. In order to
// set example values on the message for validation and check against all rules on the field,
// we pass in an extensionTypeResolver that includes imported files and reparse all extensions
// for the message to ensure that we are able to resolve predefined rules.
if err := protoencoding.ReparseExtensions(extensionTypeResolver, typeRulesMessage); err != nil {
return err
}
Expand Down

0 comments on commit a053f42

Please sign in to comment.