From 31c3319eac07f5dcf2d74d925a1f042f908aec66 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 2 Jul 2026 13:51:28 -0400 Subject: [PATCH 1/2] docs: add x-jsonschema-if extension page Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- registries/_extension/x-jsonschema-if.md | 48 ++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 registries/_extension/x-jsonschema-if.md diff --git a/registries/_extension/x-jsonschema-if.md b/registries/_extension/x-jsonschema-if.md new file mode 100644 index 0000000..049035d --- /dev/null +++ b/registries/_extension/x-jsonschema-if.md @@ -0,0 +1,48 @@ +--- +owner: mikekistler +issue: +description: The JSON Schema if conditional subschema, used when targeting OpenAPI versions that do not directly support it. +schema: + $ref: "#/$defs/schemaObject" +objects: [ "Schema Object" ] +layout: default +--- + +{% capture summary %} +The JSON Schema `if` keyword defines a conditional subschema that controls whether `then` or `else` applies. + +The `x-jsonschema-if` extension mirrors the JSON Schema `if` keyword when targeting OpenAPI versions where the keyword is not directly available. It is serialized as `x-jsonschema-if` so tools can preserve and process the conditional subschema. + +It can appear as a property in the following objects: `{{page.objects|jsonify}}`. + +Used by: (informational) + +* [Microsoft.OpenApi](https://github.com/microsoft/OpenAPI.NET) (.NET OpenAPI library) +{% endcapture %} + +{% capture example %} +```yaml +openapi: 3.0.4 +info: + title: My API + version: 1.0.0 +paths: {} +components: + schemas: + Address: + type: object + properties: + country: + type: string + postalCode: + type: string + x-jsonschema-if: + properties: + country: + const: US + required: + - country +``` +{% endcapture %} + +{% include extension-entry.md summary=summary example=example %} From c7dbc74fad2e904f022a47e97f04dd6a363ef9a3 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 2 Jul 2026 13:56:02 -0400 Subject: [PATCH 2/2] docs: update owner for x-jsonschema-if extension page Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- registries/_extension/x-jsonschema-if.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registries/_extension/x-jsonschema-if.md b/registries/_extension/x-jsonschema-if.md index 049035d..80f3d85 100644 --- a/registries/_extension/x-jsonschema-if.md +++ b/registries/_extension/x-jsonschema-if.md @@ -1,5 +1,5 @@ --- -owner: mikekistler +owner: baywet issue: description: The JSON Schema if conditional subschema, used when targeting OpenAPI versions that do not directly support it. schema: