Skip to content

Commit 36ebd8c

Browse files
committed
fix(proto): use field.label instead of is_repeated for protobuf compatibility
1 parent b3d1ad6 commit 36ebd8c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/a2a/utils/proto_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def _check_required_field_violation(
208208
) -> ValidationDetail | None:
209209
"""Check if a required field is missing or invalid."""
210210
val = getattr(msg, field.name)
211-
if field.is_repeated:
211+
if field.label == field.LABEL_REPEATED:
212212
if not val:
213213
return ValidationDetail(
214214
field=field.name,
@@ -249,7 +249,7 @@ def _recurse_validation(
249249
return errors
250250

251251
val = getattr(msg, field.name)
252-
if not field.is_repeated:
252+
if field.label != field.LABEL_REPEATED:
253253
if msg.HasField(field.name):
254254
sub_errs = _validate_proto_required_fields_internal(val)
255255
_append_nested_errors(errors, field.name, sub_errs)

0 commit comments

Comments
 (0)