From f1edd254b73ccb86aea83c274f2c72d98d364442 Mon Sep 17 00:00:00 2001 From: Karen Etheridge Date: Mon, 15 Sep 2025 12:20:24 -0700 Subject: [PATCH 1/5] use non-capturing parentheses everywhere --- src/schemas/validation/schema.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schemas/validation/schema.yaml b/src/schemas/validation/schema.yaml index b728cbfb98..1acbd738b6 100644 --- a/src/schemas/validation/schema.yaml +++ b/src/schemas/validation/schema.yaml @@ -193,7 +193,7 @@ $defs: additionalProperties: $ref: '#/$defs/path-item' patternProperties: - '^(schemas|responses|parameters|examples|requestBodies|headers|securitySchemes|links|callbacks|pathItems)$': + '^(?:schemas|responses|parameters|examples|requestBodies|headers|securitySchemes|links|callbacks|pathItems)$': $comment: Enumerating all of the property names in the regex above is necessary for unevaluatedProperties to work as expected propertyNames: pattern: '^[a-zA-Z0-9._-]+$' From d4fec14b61eb9e419c5641eb2cda368cc1bd6e54 Mon Sep 17 00:00:00 2001 From: Karen Etheridge Date: Mon, 15 Sep 2025 12:26:03 -0700 Subject: [PATCH 2/5] remove redundant "requires" - "in" is always required for "parameter" - "type" is required for "security-scheme" --- src/schemas/validation/schema.yaml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/schemas/validation/schema.yaml b/src/schemas/validation/schema.yaml index 1acbd738b6..f717cfebbb 100644 --- a/src/schemas/validation/schema.yaml +++ b/src/schemas/validation/schema.yaml @@ -341,8 +341,6 @@ $defs: properties: in: const: query - required: - - in then: properties: allowEmptyValue: @@ -369,8 +367,6 @@ $defs: properties: in: const: path - required: - - in then: properties: style: @@ -389,8 +385,6 @@ $defs: properties: in: const: header - required: - - in then: properties: style: @@ -402,8 +396,6 @@ $defs: properties: in: const: query - required: - - in then: properties: style: @@ -422,8 +414,6 @@ $defs: properties: in: const: cookie - required: - - in then: properties: style: @@ -760,8 +750,6 @@ $defs: properties: type: const: apiKey - required: - - type then: properties: name: @@ -780,8 +768,6 @@ $defs: properties: type: const: http - required: - - type then: properties: scheme: @@ -810,8 +796,6 @@ $defs: properties: type: const: oauth2 - required: - - type then: properties: flows: @@ -824,8 +808,6 @@ $defs: properties: type: const: openIdConnect - required: - - type then: properties: openIdConnectUrl: From c8565c76ab329d205d9886b0050c2073a234e774 Mon Sep 17 00:00:00 2001 From: Karen Etheridge Date: Mon, 15 Sep 2025 12:28:05 -0700 Subject: [PATCH 3/5] whitespace --- tests/schema/fail/example-examples.yaml | 3 --- tests/schema/fail/invalid_schema_types.yaml | 1 - tests/schema/pass/example-object-examples.yaml | 2 +- tests/schema/pass/valid_schema_types.yaml | 1 - tests/schema/pass/webhook-example.yaml | 1 - 5 files changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/schema/fail/example-examples.yaml b/tests/schema/fail/example-examples.yaml index 97adcadba6..6ed2f6b333 100644 --- a/tests/schema/fail/example-examples.yaml +++ b/tests/schema/fail/example-examples.yaml @@ -15,6 +15,3 @@ components: examples: a mammalian example: value: bear - - - diff --git a/tests/schema/fail/invalid_schema_types.yaml b/tests/schema/fail/invalid_schema_types.yaml index d295b1f0ed..55e3c900e3 100644 --- a/tests/schema/fail/invalid_schema_types.yaml +++ b/tests/schema/fail/invalid_schema_types.yaml @@ -10,4 +10,3 @@ components: invalid_null: null invalid_number: 0 invalid_array: [] - diff --git a/tests/schema/pass/example-object-examples.yaml b/tests/schema/pass/example-object-examples.yaml index 664b22f429..66f8f54133 100644 --- a/tests/schema/pass/example-object-examples.yaml +++ b/tests/schema/pass/example-object-examples.yaml @@ -29,7 +29,7 @@ components: summary: This is a text example externalValue: https://foo.bar/examples/address-example.txt parameters: - with-example: + with-example: name: zipCode in: query schema: diff --git a/tests/schema/pass/valid_schema_types.yaml b/tests/schema/pass/valid_schema_types.yaml index 4431adcda5..c2459ed37c 100644 --- a/tests/schema/pass/valid_schema_types.yaml +++ b/tests/schema/pass/valid_schema_types.yaml @@ -11,4 +11,3 @@ components: nothing_boolean: false anything_object: {} nothing_object: { not: {} } - diff --git a/tests/schema/pass/webhook-example.yaml b/tests/schema/pass/webhook-example.yaml index 2ac1cda985..44fc73aaa9 100644 --- a/tests/schema/pass/webhook-example.yaml +++ b/tests/schema/pass/webhook-example.yaml @@ -32,4 +32,3 @@ components: type: string tag: type: string - From 56aafd82a3a01db23209be3598bc9071d184d277 Mon Sep 17 00:00:00 2001 From: Karen Etheridge Date: Mon, 15 Sep 2025 12:29:01 -0700 Subject: [PATCH 4/5] remove confusing use of json within yaml --- .../pass/schema-object-deprecated-example-keyword.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/schema/pass/schema-object-deprecated-example-keyword.yaml b/tests/schema/pass/schema-object-deprecated-example-keyword.yaml index f66640f4c3..92fcbb41a5 100644 --- a/tests/schema/pass/schema-object-deprecated-example-keyword.yaml +++ b/tests/schema/pass/schema-object-deprecated-example-keyword.yaml @@ -12,7 +12,6 @@ paths: # the example simple type: object # DEPRECATED: don't use example keyword inside Schema Object - example: { - "numbers": [1, 2], - "flag": null - } + example: + numbers: [1, 2] + flag: null From 72de87b52b771209efcb4c1c89ed5358c2d66879 Mon Sep 17 00:00:00 2001 From: Karen Etheridge Date: Mon, 15 Sep 2025 12:32:21 -0700 Subject: [PATCH 5/5] style and allowReserved defaults are only in effect when any of style, explode, allowReserved are present see #4899 --- src/schemas/validation/schema.yaml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/schemas/validation/schema.yaml b/src/schemas/validation/schema.yaml index f717cfebbb..f4059cb1d3 100644 --- a/src/schemas/validation/schema.yaml +++ b/src/schemas/validation/schema.yaml @@ -494,7 +494,6 @@ $defs: additionalProperties: $ref: '#/$defs/header-or-reference' style: - default: form enum: - form - spaceDelimited @@ -503,8 +502,22 @@ $defs: explode: type: boolean allowReserved: - default: false type: boolean + dependentSchemas: + style: + properties: + allowReserved: + default: false + explode: + properties: + style: + default: form + allowReserved: + default: false + allowReserved: + properties: + style: + default: form allOf: - $ref: '#/$defs/specification-extensions' - $ref: '#/$defs/styles-for-form'