Skip to content

fix: updating schema to match the json schema protocol #530

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pauldotknopf
Copy link

@pauldotknopf pauldotknopf commented May 14, 2025

https://json-schema.org/draft-07/schema

"$defs" should be "definitions"

Description

Thank you for opening a Pull Request!
Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

@pauldotknopf pauldotknopf changed the title fix: updating schema to match the json schema protocol renaming $defs to definitions fix: updating schema to match the json schema protocol renaming May 14, 2025
@pauldotknopf pauldotknopf changed the title fix: updating schema to match the json schema protocol renaming fix: updating schema to match the json schema protocol May 14, 2025
@darkhaniop
Copy link
Contributor

darkhaniop commented May 14, 2025

The tool used to generate a2a.json probably used the latest version draft 2020-12. The key definitions was replaced with $defs in 2019-09 (predecessor of 2020-12).

From https://json-schema.org/draft/2019-09/draft-handrews-json-schema-validation-02#rfc.appendix.A

"definitions"
Renamed to "$defs" to match "$ref" and be shorter to type. Schema vocabulary authors SHOULD NOT define a "definitions" keyword with different behavior in order to avoid invalidating schemas that still use the older name. While "definitions" is absent in the single-vocabulary meta-schemas referenced by this document, it remains present in the default meta-schema, and implementations SHOULD assume that "$defs" and "definitions" have the same behavior when that meta-schema is used.

If that's the case, the only line that needs to be corrected is the $schema specifier from

"$schema": "http://json-schema.org/draft-07/schema#",

to:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  ...
}

Edit: add a quote from the referenced document

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants