From f6a083c3e5a3ffb7ffb4fa034c31dd1f793501be 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..ae0ed863b3 --- /dev/null +++ b/tests/schema/pass/json_schema_dialect.yaml @@ -0,0 +1,15 @@ +openapi: 3.1.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.1/dialect/WORK-IN-PROGRESS +components: + schemas: + WithDollarSchema: + $id: "locked-metaschema" + $schema: https://spec.openapis.org/oas/3.1/dialect/WORK-IN-PROGRESS +paths: {} diff --git a/tests/schema/pass/mega.yaml b/tests/schema/pass/mega.yaml index 8838c03a6d..98ce577dce 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 62151194f59a5c7ffc9bc5043df2d875475d52e5 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 | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/tests/schema/pass/media-type-examples.yaml b/tests/schema/pass/media-type-examples.yaml index 061a848b3f..ed5862f072 100644 --- a/tests/schema/pass/media-type-examples.yaml +++ b/tests/schema/pass/media-type-examples.yaml @@ -30,6 +30,26 @@ paths: breed: Mixed frog: $ref: '#/components/examples/frog-example' + 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 @@ -94,4 +114,4 @@ paths: allowReserved: true forCoverage2: style: spaceDelimited - explode: true \ No newline at end of file + explode: true From cbc870f2d9ef99fba3222af2c5a0596d9f1ae44c 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 98ce577dce..d3048850f2 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 d287f99947cec7c765d836902d08644e9238e83c 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 d3048850f2..dafae3991f 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