Class A2AVersionValidator

java.lang.Object
io.a2a.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)

If the client does not specify a version, the current protocol version (AgentInterface.CURRENT_PROTOCOL_VERSION) is assumed as the default.

  • 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