Skip to content
8 changes: 4 additions & 4 deletions protovalidate/internal/constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,13 +383,13 @@ def _validate_value(self, ctx: ConstraintContext, field_path: str, value: any_pb
ctx.add(
field_path,
"any.in",
f"Type {value.type_url} is not in {self._in}",
"type URL must be in the allow list",
)
if value.type_url in self._not_in:
ctx.add(
field_path,
"any.not_in",
f"Type {value.type_url} is in {self._not_in}",
"type URL must not be in the block list",
)


Expand Down Expand Up @@ -419,7 +419,7 @@ def validate(self, ctx: ConstraintContext, message: message.Message):
ctx.add(
self._field.name,
"enum.defined_only",
"value is not defined in enum",
"value must be one of the defined enum values",
)


Expand Down Expand Up @@ -506,7 +506,7 @@ def validate(self, ctx: ConstraintContext, message: message.Message):
ctx.add(
self._oneof.name,
"required",
"oneof is required",
"exactly one field is required in oneof",
)
return

Expand Down