Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/schemas/validation/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type: object
properties:
openapi:
type: string
pattern: '^3\.2\.\d+(-.+)?$'
pattern: '^3\.3\.\d+(-.+)?$'
$self:
type: string
format: uri-reference
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/fail/encoding-enc-item-exclusion.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/fail/encoding-enc-prefix-exclusion.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/fail/example-examples.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0

# this example should fail, as example cannot be used together with examples.

Expand Down
2 changes: 1 addition & 1 deletion tests/schema/fail/example-object-old-exclusions.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/fail/example-object-old-vs-data.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/fail/example-object-old-vs-ser.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/fail/example-object-ser-exclusions.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/fail/invalid_schema_types.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0

# this example shows invalid types for the schemaObject

Expand Down
2 changes: 1 addition & 1 deletion tests/schema/fail/media-type-enc-item-exclusion.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/fail/media-type-enc-prefix-exclusion.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/fail/no_containers.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0

# this example should fail as there are no paths, components or webhooks containers (at least one of which must be present)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/fail/operation-object-two-querystrings.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/fail/path-item-object-two-querystrings.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/fail/server_enum_empty.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0

# this example should fail as the server variable enum is empty, and so does not contain the default value

Expand Down
2 changes: 1 addition & 1 deletion tests/schema/fail/servers.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0

# this example should fail, as servers must be an array, not an object

Expand Down
2 changes: 1 addition & 1 deletion tests/schema/fail/unknown_container.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0

# this example should fail as overlays is not a valid top-level object/keyword

Expand Down
2 changes: 1 addition & 1 deletion tests/schema/fail/xml-attr-exclusion.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/fail/xml-wrapped-exclusion.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/callback-object-examples.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/comp_pathitems.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/components-object-example.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/example-object-examples.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/header-object-examples.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/info-object-example.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# including External Documentation Object Example
openapi: 3.2.0
openapi: 3.3.0
$self: https://example.com/openapi
info:
title: Example Pet Store App
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/info_summary.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
summary: My lovely API
Expand Down
6 changes: 3 additions & 3 deletions tests/schema/pass/json_schema_dialect.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
openapi: 3.2.0
openapi: 3.3.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
jsonSchemaDialect: https://spec.openapis.org/oas/3.3/dialect/WORK-IN-PROGRESS
components:
schemas:
WithDollarSchema:
$id: "locked-metaschema"
$schema: https://spec.openapis.org/oas/3.2/dialect/WORK-IN-PROGRESS
$schema: https://spec.openapis.org/oas/3.3/dialect/WORK-IN-PROGRESS
paths: {}
2 changes: 1 addition & 1 deletion tests/schema/pass/license_identifier.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
summary: My lovely API
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/link-object-examples.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/media-type-examples.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# including Encoding Object examples
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/mega.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
summary: My API's summary
title: My API
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/minimal_comp.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/minimal_hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/minimal_paths.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/non-oauth-scopes.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: Non-oAuth Scopes example
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/operation-object-example.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/parameter-object-examples.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/path-item-object-example.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/path_item_servers_parameters.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/path_no_response.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/path_var_empty_pathitem.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/paths-object-example.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/request-body-examples.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/response-object-examples.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/schema.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/security-scheme-object-examples.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/servers.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/specification-extensions.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/tag-object-example.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: API
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/valid_schema_types.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.1
openapi: 3.3.0

# this example shows that top-level schemaObjects MAY be booleans

Expand Down
2 changes: 1 addition & 1 deletion tests/schema/pass/webhook-example.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.2.0
openapi: 3.3.0
info:
title: Webhook Example
version: 1.0.0
Expand Down
4 changes: 2 additions & 2 deletions tests/schema/schema.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
await registerSchema("./src/schemas/validation/schema.yaml");
const fixtures = './tests/schema';

describe("v3.2", () => {
describe("v3.3", () => {
test("schema.yaml schema test", async () => {
// Files in the pass/fail folders get run against schema-base.yaml.
// This instance is instead run against schema.yaml.
const oad = {
openapi: "3.2.0",
openapi: "3.3.0",
info: {
title: "API",
version: "1.0.0"
Expand All @@ -38,7 +38,7 @@
.forEach((entry) => {
test(entry.name, async () => {
const instance = parseYamlFromFile(`${fixtures}/pass/${entry.name}`);
await expect(instance).to.matchJsonSchema("./src/schemas/validation/schema-base.yaml");

Check failure on line 41 in tests/schema/schema.test.mjs

View workflow job for this annotation

GitHub Actions / test

tests/schema/schema.test.mjs > v3.3 > Pass > json_schema_dialect.yaml

Error: { "valid": false, "errors": [ { "keyword": "https://json-schema.org/keyword/const", "absoluteKeywordLocation": "https://spec.openapis.org/oas/3.2/schema-base/WORK-IN-PROGRESS#/$defs/dialect/const", "instanceLocation": "#/components/schemas/WithDollarSchema/$schema" }, { "keyword": "https://json-schema.org/evaluation/validate", "absoluteKeywordLocation": "https://spec.openapis.org/oas/3.2/schema/WORK-IN-PROGRESS#/$defs/components/unevaluatedProperties", "instanceLocation": "#/components/schemas" }, { "keyword": "https://json-schema.org/evaluation/validate", "absoluteKeywordLocation": "https://spec.openapis.org/oas/3.2/schema/WORK-IN-PROGRESS#/unevaluatedProperties", "instanceLocation": "#/openapi" }, { "keyword": "https://json-schema.org/evaluation/validate", "absoluteKeywordLocation": "https://spec.openapis.org/oas/3.2/schema/WORK-IN-PROGRESS#/unevaluatedProperties", "instanceLocation": "#/info" }, { "keyword": "https://json-schema.org/evaluation/validate", "absoluteKeywordLocation": "https://spec.openapis.org/oas/3.2/schema/WORK-IN-PROGRESS#/unevaluatedProperties", "instanceLocation": "#/jsonSchemaDialect" }, { "keyword": "https://json-schema.org/evaluation/validate", "absoluteKeywordLocation": "https://spec.openapis.org/oas/3.2/schema/WORK-IN-PROGRESS#/unevaluatedProperties", "instanceLocation": "#/components" }, { "keyword": "https://json-schema.org/evaluation/validate", "absoluteKeywordLocation": "https://spec.openapis.org/oas/3.2/schema/WORK-IN-PROGRESS#/unevaluatedProperties", "instanceLocation": "#/paths" }, { "keyword": "https://json-schema.org/keyword/const", "absoluteKeywordLocation": "https://spec.openapis.org/oas/3.2/schema-base/WORK-IN-PROGRESS#/$defs/dialect/const", "instanceLocation": "#/jsonSchemaDialect" } ] } ❯ tests/schema/schema.test.mjs:41:11
});
});
});
Expand Down
Loading