Is your feature request related to a problem? Please describe.
The A2A Protocol Specification (Section 4.1.7) states that an Artifact's parts array "Must contain at least one part."
However, this constraint is not reflected in the protobuf schema definition at specification/a2a.proto.
Describe the solution you'd like
Current Schema
specification/a2a.proto
message Artifact {
// Unique identifier (e.g. UUID) for the artifact. It must be at least unique
// within a task.
string artifact_id = 1 [(google.api.field_behavior) = REQUIRED];
// A human readable name for the artifact.
string name = 3;
// A human readable description of the artifact, optional.
string description = 4;
// The content of the artifact. Must contain at least one part.
repeated Part parts = 5 [(google.api.field_behavior) = REQUIRED];
// Optional metadata included with the artifact.
google.protobuf.Struct metadata = 6;
// The URIs of extensions that are present or contributed to this Artifact.
repeated string extensions = 7;
}
specification/buf.yaml
version: v2
deps:
# Common Protobuf types.
- buf.build/googleapis/googleapis
Proposed Change
specification/a2a.proto
+ import "buf/validate/validate.proto";
message Artifact {
// Unique identifier (e.g. UUID) for the artifact. It must be at least unique
// within a task.
string artifact_id = 1 [(google.api.field_behavior) = REQUIRED];
// A human readable name for the artifact.
string name = 3;
// A human readable description of the artifact, optional.
string description = 4;
// The content of the artifact. Must contain at least one part.
- repeated Part parts = 5 [(google.api.field_behavior) = REQUIRED];
+ repeated Part parts = 5 [
+ (google.api.field_behavior) = REQUIRED,
+ (buf.validate.field).repeated.min_items = 1
+ ];
// Optional metadata included with the artifact.
google.protobuf.Struct metadata = 6;
// The URIs of extensions that are present or contributed to this Artifact.
repeated string extensions = 7;
}
specification/buf.yaml
version: v2
deps:
# Common Protobuf types.
- buf.build/googleapis/googleapis
+ - buf.build/bufbuild/protovalidate
Why This Matters
SDKs that generate models from predefined schema in A2A repository (e.g., https://github.com/a2aproject/a2a-python using datamodel-codegen) do not automatically enforce the non-empty constraint because the schema lacks min_items. This means invalid Artifact objects with empty parts can be created without any validation error.
- The Java SDK already enforces this at the code level but this should be driven by the schema itself.
- The Python SDK applied a manual fix in below but since
types.py is auto-generated from this schema, the fix will be overwritten on the next regeneration.
Describe alternatives you've considered
No response
Additional context
No response
Code of Conduct
Is your feature request related to a problem? Please describe.
The A2A Protocol Specification (Section 4.1.7) states that an Artifact's
partsarray "Must contain at least one part."However, this constraint is not reflected in the protobuf schema definition at
specification/a2a.proto.Describe the solution you'd like
Current Schema
specification/a2a.proto
specification/buf.yaml
Proposed Change
specification/a2a.proto
specification/buf.yaml
version: v2 deps: # Common Protobuf types. - buf.build/googleapis/googleapis + - buf.build/bufbuild/protovalidateWhy This Matters
SDKs that generate models from predefined schema in A2A repository (e.g., https://github.com/a2aproject/a2a-python using
datamodel-codegen) do not automatically enforce the non-empty constraint because the schema lacksmin_items. This means invalidArtifactobjects with empty parts can be created without any validation error.types.pyis auto-generated from this schema, the fix will be overwritten on the next regeneration.partsinArtifactmodel to match A2A Specification a2a-python#670min_lengthforpartsinArtifacta2a-python#671Describe alternatives you've considered
No response
Additional context
No response
Code of Conduct