Description
protobuf v34.0 removed deprecated field FieldDescriptor.label, which is referenced in internal/rules.py
This is causing AttributeError when calling protovalidate.validate(message)
Steps to Reproduce
- Install
protobuf >= 7.34.0
- Run
protovalidate.validate(message) on any message
Expected Behavior
protovalidate.validate(message) validates the protobuf message.
Actual Behavior
protovalidate.validate(message) raises an AttributeError
Screenshots/Logs
if field.message_type.GetOptions().map_entry:
key_field = field.message_type.fields_by_name["key"]
value_field = field.message_type.fields_by_name["value"]
if value_field.type != descriptor.FieldDescriptor.TYPE_MESSAGE:
continue
result.append(MapValMsgRule(self, field, key_field, value_field))
> elif field.label == descriptor.FieldDescriptor.LABEL_REPEATED:
E AttributeError: 'google._upb._message.FieldDescriptor' object has no attribute 'label'
pip list | grep proto
protobuf 7.34.1
protovalidate 1.1.0
Environment
- Operating System: Linux
- Version: Ubuntu 22.04
- Compiler/Toolchain: N/A
- Protobuf Compiler & Version: libprotoc 25.1
- Protovalidate Version: 1.1.0
Possible Solution
Migration: Rely on isRepeated and isRequired for cardinality and hasPresence to check for explicit presence tracking in singular fields.
https://protobuf.dev/news/2025-07-14/
Additional Context
Description
protobuf v34.0 removed deprecated field
FieldDescriptor.label, which is referenced in internal/rules.pyThis is causing
AttributeErrorwhen callingprotovalidate.validate(message)Steps to Reproduce
protobuf >= 7.34.0protovalidate.validate(message)on any messageExpected Behavior
protovalidate.validate(message)validates the protobuf message.Actual Behavior
protovalidate.validate(message)raises anAttributeErrorScreenshots/Logs
Environment
Possible Solution
https://protobuf.dev/news/2025-07-14/
Additional Context