Skip to content

Make the client_to_server_list and server_to_client_list a dict, since the places we plan to use this DataPart.data, MCP response payload, seem to be built around dicts and don't support lists.#1055

Open
wrenj wants to merge 1 commit intogoogle:mainfrom
wrenj:list

Conversation

@wrenj
Copy link
Copy Markdown
Collaborator

@wrenj wrenj commented Apr 2, 2026

Make the client_to_server_list and server_to_client_list a dict, since the places we plan to use this DataPart.data, MCP response payload, seem to be built around dicts and don't support lists.

…e the places we plan to use this DataPart.data, MCP response payload, seem to be built around dicts and don't support lists.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the JSON schemas for client-to-server and server-to-client message lists in versions 0.9 and 0.10, changing the root structure from a simple array to an object containing an array. The reviewer recommends renaming the "items" property to "messages" to ensure compatibility with existing validation scripts and adding "additionalProperties": false to maintain the strictness of the specification.

Comment on lines +6 to +17
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "client_to_server.json"
}
}
},
"required": [
"items"
]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

To maintain consistency with the existing validation tooling in specification/scripts/validate.py (which expects a messages key when wrapping a list in an object) and to ensure strictness, I recommend renaming the items property to messages and adding "additionalProperties": false.

Using messages avoids breaking the current validation logic for example files. Adding additionalProperties: false aligns with the strict schema definitions used throughout the rest of the specification.

  "type": "object",
  "additionalProperties": false,
  "properties": {
    "messages": {
      "type": "array",
      "items": {
        "$ref": "client_to_server.json"
      }
    }
  },
  "required": [
    "messages"
  ]
References
  1. Code should follow best practices and maintain consistency with existing repository tooling and principles. (link)

Comment on lines +6 to +17
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "server_to_client.json"
}
}
},
"required": [
"items"
]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

To maintain consistency with the existing validation tooling in specification/scripts/validate.py and to ensure strictness, I recommend renaming the items property to messages and adding "additionalProperties": false.

This ensures that example files following this schema can be correctly processed by the validation script and maintains the strictness found in other parts of the A2UI specification.

  "type": "object",
  "additionalProperties": false,
  "properties": {
    "messages": {
      "type": "array",
      "items": {
        "$ref": "server_to_client.json"
      }
    }
  },
  "required": [
    "messages"
  ]
References
  1. Code should follow best practices and maintain consistency with existing repository tooling and principles. (link)

Comment on lines +6 to +17
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "client_to_server.json"
}
}
},
"required": [
"items"
]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

To maintain consistency with the existing validation tooling in specification/scripts/validate.py and to ensure strictness, I recommend renaming the items property to messages and adding "additionalProperties": false.

Renaming to messages ensures compatibility with the current validation logic, and additionalProperties: false ensures the schema remains strict.

  "type": "object",
  "additionalProperties": false,
  "properties": {
    "messages": {
      "type": "array",
      "items": {
        "$ref": "client_to_server.json"
      }
    }
  },
  "required": [
    "messages"
  ]
References
  1. Code should follow best practices and maintain consistency with existing repository tooling and principles. (link)

Comment on lines +6 to +17
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "server_to_client.json"
}
}
},
"required": [
"items"
]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

To maintain consistency with the existing validation tooling in specification/scripts/validate.py and to ensure strictness, I recommend renaming the items property to messages and adding "additionalProperties": false.

This change ensures that the validation script can correctly identify the list of messages and maintains consistency with the strict schema design used in other A2UI files.

  "type": "object",
  "additionalProperties": false,
  "properties": {
    "messages": {
      "type": "array",
      "items": {
        "$ref": "server_to_client.json"
      }
    }
  },
  "required": [
    "messages"
  ]
References
  1. Code should follow best practices and maintain consistency with existing repository tooling and principles. (link)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant