{ "type": null } in profiles.schema.json violates JSON Schema draft 2019-09 meta-schema #11138

Open
opened 2026-01-31 02:39:37 +00:00 by claunia · 0 comments
Owner

Originally created by @KalleOlaviNiemitalo on GitHub (Oct 23, 2020).

https://aka.ms/terminal-profiles-schema redirects to https://raw.githubusercontent.com/microsoft/terminal/release-1.3/doc/cascadia/profiles.schema.json, i.e. the raw view of https://github.com/microsoft/terminal/blob/release-1.3/doc/cascadia/profiles.schema.json. That schema uses the https://json-schema.org/draft/2019-09/schema# meta-schema:

https://github.com/microsoft/terminal/blob/327ddd702307952c315b07fc7a815d56fd68f7ba/doc/cascadia/profiles.schema.json#L3

The #/definitions/CloseOtherTabsAction and #/definitions/CloseTabsAfterAction schemas have a subschema { "type": null }:

https://github.com/microsoft/terminal/blob/327ddd702307952c315b07fc7a815d56fd68f7ba/doc/cascadia/profiles.schema.json#L401
https://github.com/microsoft/terminal/blob/327ddd702307952c315b07fc7a815d56fd68f7ba/doc/cascadia/profiles.schema.json#L420

That is not valid according to https://tools.ietf.org/html/draft-handrews-json-schema-validation-02#section-6.1.1, referenced by http://json-schema.org/specification-links.html#2019-09-formerly-known-as-draft-8. The value of type "MUST be either a string or an array"; null is neither.

{ "type": "null" } would be valid according to the meta-schema, but it would not match the documentation https://docs.microsoft.com/windows/terminal/customize-settings/actions#close-tabs-after-index, which says that the index property is optional but does not say that an explicit { "index": null } is allowed.

The null literals were added in https://github.com/microsoft/terminal/pull/7390. Meta-schemas were also discussed in https://github.com/microsoft/terminal/issues/7683.

Originally created by @KalleOlaviNiemitalo on GitHub (Oct 23, 2020). <https://aka.ms/terminal-profiles-schema> redirects to <https://raw.githubusercontent.com/microsoft/terminal/release-1.3/doc/cascadia/profiles.schema.json>, i.e. the raw view of <https://github.com/microsoft/terminal/blob/release-1.3/doc/cascadia/profiles.schema.json>. That schema uses the <https://json-schema.org/draft/2019-09/schema#> meta-schema: <https://github.com/microsoft/terminal/blob/327ddd702307952c315b07fc7a815d56fd68f7ba/doc/cascadia/profiles.schema.json#L3> The `#/definitions/CloseOtherTabsAction` and `#/definitions/CloseTabsAfterAction` schemas have a subschema ` { "type": null }`: <https://github.com/microsoft/terminal/blob/327ddd702307952c315b07fc7a815d56fd68f7ba/doc/cascadia/profiles.schema.json#L401> <https://github.com/microsoft/terminal/blob/327ddd702307952c315b07fc7a815d56fd68f7ba/doc/cascadia/profiles.schema.json#L420> That is not valid according to <https://tools.ietf.org/html/draft-handrews-json-schema-validation-02#section-6.1.1>, referenced by <http://json-schema.org/specification-links.html#2019-09-formerly-known-as-draft-8>. The value of **type** "MUST be either a string or an array"; `null` is neither. `{ "type": "null" }` would be valid according to the meta-schema, but it would not match the documentation <https://docs.microsoft.com/windows/terminal/customize-settings/actions#close-tabs-after-index>, which says that the `index` property is optional but does not say that an explicit `{ "index": null }` is allowed. The `null` literals were added in <https://github.com/microsoft/terminal/pull/7390>. Meta-schemas were also discussed in <https://github.com/microsoft/terminal/issues/7683>.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#11138