diff --git a/internal/evaluator/builder.go b/internal/evaluator/builder.go index a465504..488bdf8 100644 --- a/internal/evaluator/builder.go +++ b/internal/evaluator/builder.go @@ -268,7 +268,7 @@ func (bldr *Builder) processFieldExpressions( var opts []cel.EnvOption if fieldDesc.Kind() == protoreflect.MessageKind { opts = []cel.EnvOption{ - cel.TypeDescs(fieldDesc.ParentFile()), + cel.TypeDescs(fieldDesc.Message().ParentFile()), cel.Variable("this", cel.ObjectType(string(fieldDesc.Message().FullName()))), } } else { diff --git a/proto/tests/example/v1/validations.proto b/proto/tests/example/v1/validations.proto index 3a5af1d..e45b156 100644 --- a/proto/tests/example/v1/validations.proto +++ b/proto/tests/example/v1/validations.proto @@ -130,4 +130,4 @@ message TransitiveFieldConstraint { message: "mask.paths must not be empty", expression: "has(this.paths)", }]; -} \ No newline at end of file +}