From f9b0017867f41da4ff01277381a8e5d0c63fd214 Mon Sep 17 00:00:00 2001 From: "Henry H. Andrews" Date: Thu, 12 Jun 2025 16:01:14 -0700 Subject: [PATCH 1/4] Use matching jsonSchemaDialect Since we are testing with a placeholder, we need to match the placeholder. This will unfortunately need to be different on each new release line branch, so let's separate this test case into its own file. --- tests/schema/pass/json_schema_dialect.yaml | 15 +++++++++++++++ tests/schema/pass/mega.yaml | 1 - 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 tests/schema/pass/json_schema_dialect.yaml diff --git a/tests/schema/pass/json_schema_dialect.yaml b/tests/schema/pass/json_schema_dialect.yaml new file mode 100644 index 0000000000..fa054c9b89 --- /dev/null +++ b/tests/schema/pass/json_schema_dialect.yaml @@ -0,0 +1,15 @@ +openapi: 3.2.0 +info: + summary: Testing jsonSchemaDialect + title: My API + version: 1.0.0 + license: + name: Apache 2.0 + identifier: Apache-2.0 +jsonSchemaDialect: https://spec.openapis.org/oas/3.2/dialect/WORK-IN-PROGRESS +components: + schemas: + WithDollarSchema: + $id: "locked-metaschema" + $schema: https://spec.openapis.org/oas/3.2/dialect/WORK-IN-PROGRESS +paths: {} diff --git a/tests/schema/pass/mega.yaml b/tests/schema/pass/mega.yaml index a0179b64bd..db953e866d 100644 --- a/tests/schema/pass/mega.yaml +++ b/tests/schema/pass/mega.yaml @@ -6,7 +6,6 @@ info: license: name: Apache 2.0 identifier: Apache-2.0 -jsonSchemaDialect: https://spec.openapis.org/oas/3.1/dialect/base paths: /: get: From 98ae842fc613ca9e45777f0707ab148a50a5ba6c Mon Sep 17 00:00:00 2001 From: "Henry H. Andrews" Date: Thu, 12 Jun 2025 19:03:38 -0700 Subject: [PATCH 2/4] Add XML Object schema tests --- tests/schema/pass/media-type-examples.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/schema/pass/media-type-examples.yaml b/tests/schema/pass/media-type-examples.yaml index 3a8e880f7a..5a263f037f 100644 --- a/tests/schema/pass/media-type-examples.yaml +++ b/tests/schema/pass/media-type-examples.yaml @@ -33,6 +33,26 @@ paths: application/jsonl: itemSchema: $ref: '#components/schemas/Pet' + application/xml: + schema: + type: object + properties: + foo: + type: string + xml: + namespace: https://example.com + prefix: example + name: Foo + bar: + type: array + items: + type: number + xml: + wrapped: true + attr: + type: string + xml: + attribute: true application/x-www-form-urlencoded: schema: type: object From 0a223cd69875c7fd5978ac8c744735c8e24dcb32 Mon Sep 17 00:00:00 2001 From: "Henry H. Andrews" Date: Thu, 12 Jun 2025 19:08:52 -0700 Subject: [PATCH 3/4] Use externalDocs in a schema test object --- tests/schema/pass/mega.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/schema/pass/mega.yaml b/tests/schema/pass/mega.yaml index db953e866d..7d2f5fc0da 100644 --- a/tests/schema/pass/mega.yaml +++ b/tests/schema/pass/mega.yaml @@ -27,6 +27,9 @@ components: content: 'application/json': schema: + externalDocs: + description: More docs! + url: https://example.com/elsewhere.html type: object properties: type: From 27516b6103df3cb5c4bb986eb199023ee39561df Mon Sep 17 00:00:00 2001 From: "Henry H. Andrews" Date: Thu, 12 Jun 2025 19:13:36 -0700 Subject: [PATCH 4/4] Cover discriminator with schema test cases Also make the discriminator usage valid. --- tests/schema/pass/mega.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/schema/pass/mega.yaml b/tests/schema/pass/mega.yaml index 7d2f5fc0da..3e57fb9144 100644 --- a/tests/schema/pass/mega.yaml +++ b/tests/schema/pass/mega.yaml @@ -19,6 +19,12 @@ components: securitySchemes: mtls: type: mutualTLS + schemas: + Foo: + type: object + properties: + type: + const: foo pathItems: myPathItem: post: @@ -47,5 +53,9 @@ components: type: ['string','null'] discriminator: propertyName: type + mapping: + foo: Foo x-extension: true + anyOf: + - $ref: "#/components/schemas/Foo" myArbitraryKeyword: true