You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if protovalidate supports fieldmask. I.e. if a call to the validator can include a fieldmask, and only the fields covered by the fieldmask are validated.
This would solve the problem of gRPC Update calls, where the Update contains only a subset of the fields, so a full validation will fail.
There's a few workarounds, sometimes using ignore_empty helps, sometimes it doesn't.
Also adding CEL expressions to the UpdateXYRequest works, but it's not a replacement for field-level rules imho.
The text was updated successfully, but these errors were encountered:
Thanks for the suggestion. While fieldmask support isn't on our immediate roadmap, we're always enthusiastic about community contributions. To increase the likelihood of someone from the community picking this up and ensuring it's implemented correctly, could you provide more detailed use cases or specific scenarios where this feature would be most beneficial? This will help potential contributors understand the context better.
We really appreciate your engagement and contribution to our community.
The way we were resolving the CEL types for type-checking expressions
was inconsistent between custom and standard constraints. Resulting in
compilation errors (particularly around repeated fields). Logic shared
between the two (mostly lookups) was moved into the `expression`
internal package and used uniformly for both environments.
This also improves on a previously discovered bug around the Any WKT
where custom expressions against such a field would fail with a runtime
error if its underlying type was not known to CEL (CEL treats Any's as
the underlying type, instead of the Any message itself). The standard
constraints on Any do not have this limitation. We are populating the
root CEL environment with `protoregistry.GlobalFiles` for now, but will
likely make this configurable in the long-run.
Context:
bufbuild#92 (comment)
(h/t @matthewpi)
It would be great if protovalidate supports fieldmask. I.e. if a call to the validator can include a fieldmask, and only the fields covered by the fieldmask are validated.
This would solve the problem of gRPC Update calls, where the Update contains only a subset of the fields, so a full validation will fail.
There's a few workarounds, sometimes using ignore_empty helps, sometimes it doesn't.
Also adding CEL expressions to the UpdateXYRequest works, but it's not a replacement for field-level rules imho.
The text was updated successfully, but these errors were encountered: