Class A2AVersionValidator

java.lang.Object
org.a2aproject.sdk.server.version.A2AVersionValidator

public class A2AVersionValidator extends Object
Utility class for validating A2A protocol version compatibility between clients and agents.

Version validation follows semantic versioning rules:

  • Major versions must match exactly (1.x can only talk to 1.x)
  • Minor versions are compatible (1.0 client can talk to 1.1 server and vice versa)

Per A2A spec Section 3.6.2, if the client does not specify a version, version "0.3" is assumed for backward compatibility.

  • Constructor Details

    • A2AVersionValidator

      public A2AVersionValidator()
  • Method Details

    • validateProtocolVersion

      public static void validateProtocolVersion(AgentCard agentCard, ServerCallContext context) throws VersionNotSupportedError
      Validates that the client's requested protocol version is compatible with the agent's supported versions across all interfaces.
      Parameters:
      agentCard - the agent card containing the supported interfaces with their protocol versions
      context - the server call context containing the requested protocol version
      Throws:
      VersionNotSupportedError - if the versions are incompatible