Skip to content

Conversation

@jba
Copy link
Contributor

@jba jba commented Aug 6, 2025

Marshal the empty schema to true, and its negation to false.

This is technically a breaking behavior change, but a properly written consumer of JSON Schema will not notice.

For #244.

Fixes #230.

Marshal the empty schema to true, and its negation to false.

This is a breaking behavior change, but a properly written consumer
of JSON Schema will not notice.
@jba jba requested review from findleyr and samthanawalla August 6, 2025 14:02
samthanawalla
samthanawalla previously approved these changes Aug 6, 2025
{`true`, `{}`}, // boolean schemas become object schemas
{`false`, `{"not":{}}`},
{`{"type":"", "enum":null}`, `{}`}, // empty fields are omitted
{`true`, `true`},
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to make both of these changes, or just 'false'?
I've not seen many examples of a schema being 'true', but have seen examples of a schema being 'false'.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems odd to do one without the other.

@jba jba merged commit c132621 into modelcontextprotocol:main Aug 6, 2025
5 checks passed
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.

additionalProperties is boolean

3 participants