') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); fix "openapi" field to accept 3.3 versions by karenetheridge · Pull Request #5033 · OAI/OpenAPI-Specification · GitHub
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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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