From a99ac35b0064a48a7a06532f0b81d33f8d938ee8 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 2 Jul 2026 13:51:32 -0400 Subject: [PATCH 1/2] docs: add x-jsonschema-else extension page Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- registries/_extension/x-jsonschema-else.md | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 registries/_extension/x-jsonschema-else.md diff --git a/registries/_extension/x-jsonschema-else.md b/registries/_extension/x-jsonschema-else.md new file mode 100644 index 0000000..6520d15 --- /dev/null +++ b/registries/_extension/x-jsonschema-else.md @@ -0,0 +1,54 @@ +--- +owner: mikekistler +issue: +description: The JSON Schema else conditional subschema, used with x-jsonschema-if when targeting OpenAPI versions that do not directly support it. +schema: + $ref: "#/$defs/schemaObject" +objects: [ "Schema Object" ] +layout: default +--- + +{% capture summary %} +The JSON Schema `else` keyword defines the subschema that applies when the `if` subschema does not match. + +The `x-jsonschema-else` extension mirrors the JSON Schema `else` keyword when targeting OpenAPI versions where the keyword is not directly available. It is serialized as `x-jsonschema-else` so tools can preserve and process the conditional subschema alongside `x-jsonschema-if`. + +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 + x-jsonschema-else: + properties: + postalCode: + minLength: 1 + required: + - postalCode +``` +{% endcapture %} + +{% include extension-entry.md summary=summary example=example %} From 3551e0cae496686ab7a9267f2456be1635a74775 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 2 Jul 2026 13:56:05 -0400 Subject: [PATCH 2/2] docs: update owner for x-jsonschema-else extension page Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- registries/_extension/x-jsonschema-else.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registries/_extension/x-jsonschema-else.md b/registries/_extension/x-jsonschema-else.md index 6520d15..07a496b 100644 --- a/registries/_extension/x-jsonschema-else.md +++ b/registries/_extension/x-jsonschema-else.md @@ -1,5 +1,5 @@ --- -owner: mikekistler +owner: baywet issue: description: The JSON Schema else conditional subschema, used with x-jsonschema-if when targeting OpenAPI versions that do not directly support it. schema: