|
1 | 1 | <!DOCTYPE html><html lang="en"><head> |
2 | 2 | <meta charset="UTF-8"> |
3 | | -<meta name="generator" content="ReSpec 35.2.2"> |
| 3 | +<meta name="generator" content="ReSpec 35.3.0"> |
4 | 4 | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> |
5 | 5 | <style> |
6 | 6 | dfn{cursor:pointer} |
|
22 | 22 | .dfn-panel li{margin-left:1em} |
23 | 23 | .dfn-panel.docked{position:fixed;left:.5em;top:unset;bottom:2em;margin:0 auto;max-width:calc(100vw - .75em * 2 - .5em - .2em * 2);max-height:30vh;overflow:auto} |
24 | 24 | </style> |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | +<script async="" src="https://www.googletagmanager.com/gtag/js?id=UA-831873-42"></script> |
| 30 | + |
| 31 | +<script> |
| 32 | + window.dataLayer = window.dataLayer || []; |
| 33 | + function gtag(){dataLayer.push(arguments);} |
| 34 | + gtag('js', new Date()); |
| 35 | + gtag('config', 'UA-831873-42'); |
| 36 | +</script> |
| 37 | + |
| 38 | + |
25 | 39 | <title>OpenAPI Specification v2.0</title> |
26 | 40 | <meta name="description" content="The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for HTTP APIs."> |
| 41 | + |
27 | 42 | <meta name="color-scheme" content="light dark"> |
28 | | -<script type="text/javascript" async="" src="https://www.google-analytics.com/analytics.js"></script> |
29 | | -<script type="text/javascript" async="" src="https://www.googletagmanager.com/gtag/js?id=G-JR4K3ZJLPH&l=dataLayer&cx=c&gtm=457e5350za200&tag_exp=102015666~102067808~102482433~102539968~102558064~102587591~102605417~102640600~102717422~102732003~102788824"></script> |
30 | 43 | <style id="respec-mainstyle"> |
31 | 44 | @keyframes pop{ |
32 | 45 | 0%{transform:scale(1,1)} |
|
72 | 85 | } |
73 | 86 | </style> |
74 | 87 |
|
75 | | -<script async="" src="https://www.googletagmanager.com/gtag/js?id=UA-831873-42"></script> |
76 | | - |
77 | | -<script> |
78 | | - window.dataLayer = window.dataLayer || []; |
79 | | - function gtag(){dataLayer.push(arguments);} |
80 | | - gtag('js', new Date()); |
81 | | - gtag('config', 'UA-831873-42'); |
82 | | -</script> |
83 | | - |
84 | 88 | <link rel="canonical" href="https://spec.openapis.org/oas/v2.0.html"> |
85 | 89 | <style> |
| 90 | +var:hover{text-decoration:underline;cursor:pointer} |
| 91 | +var.respec-hl{color:var(--color,#000);background-color:var(--bg-color);box-shadow:0 0 0 2px var(--bg-color)} |
| 92 | +@media (prefers-color-scheme:dark){ |
| 93 | +var.respec-hl{filter:saturate(.9) brightness(.9)} |
| 94 | +} |
| 95 | +var.respec-hl-c1{--bg-color:#f4d200} |
| 96 | +var.respec-hl-c2{--bg-color:#ff87a2} |
| 97 | +var.respec-hl-c3{--bg-color:#96e885} |
| 98 | +var.respec-hl-c4{--bg-color:#3eeed2} |
| 99 | +var.respec-hl-c5{--bg-color:#eacfb6} |
| 100 | +var.respec-hl-c6{--bg-color:#82ddff} |
| 101 | +var.respec-hl-c7{--bg-color:#ffbcf2} |
| 102 | +@media print{ |
| 103 | +var.respec-hl{background:0 0;color:#000;box-shadow:unset} |
| 104 | +} |
| 105 | +</style> |
| 106 | +<style> |
86 | 107 | var{position:relative;cursor:pointer} |
87 | 108 | var[data-type]::after,var[data-type]::before{position:absolute;left:50%;top:-6px;opacity:0;transition:opacity .4s;pointer-events:none} |
88 | 109 | var[data-type]::before{content:"";transform:translateX(-50%);border-width:4px 6px 0 6px;border-style:solid;border-color:transparent;border-top-color:#222} |
|
176 | 197 | "generatedSubtitle": "08 September 2014" |
177 | 198 | }</script> |
178 | 199 | <link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/2021/base.css"> |
179 | | -<link rel="stylesheet" media="(prefers-color-scheme: dark)" href="https://www.w3.org/StyleSheets/TR/2021/dark.css"></head><body class="h-entry"><div class="head"> |
| 200 | +<link rel="stylesheet" media="(prefers-color-scheme: dark)" href="https://www.w3.org/StyleSheets/TR/2021/dark.css"></head> |
| 201 | +<body class="h-entry"><div class="head"> |
180 | 202 | <p class="logos"><a class="logo" href="https://openapis.org/"><img crossorigin="" alt="OpenAPI Initiative" height="48" src="https://raw.githubusercontent.com/OAI/OpenAPI-Style-Guide/master/graphics/bitmap/OpenAPI_Logo_Pantone.png"> |
181 | 203 | </a></p> |
182 | 204 | <h1 id="title" class="title">OpenAPI Specification v2.0 </h1> <h2 id="subtitle" class="subtitle">Version 2.0</h2> |
@@ -3283,7 +3305,104 @@ <h1 id="title" class="title">OpenAPI Specification v2.0 </h1> <h2 id="subtitle" |
3283 | 3305 | <ul> |
3284 | 3306 | <li>Not referenced in this document.</li> |
3285 | 3307 | </ul> |
3286 | | - </div><script id="respec-dfn-panel">(() => { |
| 3308 | + </div><script id="respec-highlight-vars">(() => { |
| 3309 | +// @ts-check |
| 3310 | + |
| 3311 | +if (document.respec) { |
| 3312 | + document.respec.ready.then(setupVarHighlighter); |
| 3313 | +} else { |
| 3314 | + setupVarHighlighter(); |
| 3315 | +} |
| 3316 | + |
| 3317 | +function setupVarHighlighter() { |
| 3318 | + document |
| 3319 | + .querySelectorAll("var") |
| 3320 | + .forEach(varElem => varElem.addEventListener("click", highlightListener)); |
| 3321 | +} |
| 3322 | + |
| 3323 | +function highlightListener(ev) { |
| 3324 | + ev.stopPropagation(); |
| 3325 | + const { target: varElem } = ev; |
| 3326 | + const hightligtedElems = highlightVars(varElem); |
| 3327 | + const resetListener = () => { |
| 3328 | + const hlColor = getHighlightColor(varElem); |
| 3329 | + hightligtedElems.forEach(el => removeHighlight(el, hlColor)); |
| 3330 | + [...HL_COLORS.keys()].forEach(key => HL_COLORS.set(key, true)); |
| 3331 | + }; |
| 3332 | + if (hightligtedElems.length) { |
| 3333 | + document.body.addEventListener("click", resetListener, { once: true }); |
| 3334 | + } |
| 3335 | +} |
| 3336 | + |
| 3337 | +// availability of highlight colors. colors from var.css |
| 3338 | +const HL_COLORS = new Map([ |
| 3339 | + ["respec-hl-c1", true], |
| 3340 | + ["respec-hl-c2", true], |
| 3341 | + ["respec-hl-c3", true], |
| 3342 | + ["respec-hl-c4", true], |
| 3343 | + ["respec-hl-c5", true], |
| 3344 | + ["respec-hl-c6", true], |
| 3345 | + ["respec-hl-c7", true], |
| 3346 | +]); |
| 3347 | + |
| 3348 | +function getHighlightColor(target) { |
| 3349 | + // return current colors if applicable |
| 3350 | + const { value } = target.classList; |
| 3351 | + const re = /respec-hl-\w+/; |
| 3352 | + const activeClass = re.test(value) && value.match(re); |
| 3353 | + if (activeClass) return activeClass[0]; |
| 3354 | + |
| 3355 | + // first color preference |
| 3356 | + if (HL_COLORS.get("respec-hl-c1") === true) return "respec-hl-c1"; |
| 3357 | + |
| 3358 | + // otherwise get some other available color |
| 3359 | + return [...HL_COLORS.keys()].find(c => HL_COLORS.get(c)) || "respec-hl-c1"; |
| 3360 | +} |
| 3361 | + |
| 3362 | +function highlightVars(varElem) { |
| 3363 | + const textContent = norm(varElem.textContent); |
| 3364 | + const parent = varElem.closest(".algorithm, section"); |
| 3365 | + const highlightColor = getHighlightColor(varElem); |
| 3366 | + |
| 3367 | + const varsToHighlight = [...parent.querySelectorAll("var")].filter( |
| 3368 | + el => |
| 3369 | + norm(el.textContent) === textContent && |
| 3370 | + el.closest(".algorithm, section") === parent |
| 3371 | + ); |
| 3372 | + |
| 3373 | + // update availability of highlight color |
| 3374 | + const colorStatus = varsToHighlight[0].classList.contains("respec-hl"); |
| 3375 | + HL_COLORS.set(highlightColor, colorStatus); |
| 3376 | + |
| 3377 | + // highlight vars |
| 3378 | + if (colorStatus) { |
| 3379 | + varsToHighlight.forEach(el => removeHighlight(el, highlightColor)); |
| 3380 | + return []; |
| 3381 | + } else { |
| 3382 | + varsToHighlight.forEach(el => addHighlight(el, highlightColor)); |
| 3383 | + } |
| 3384 | + return varsToHighlight; |
| 3385 | +} |
| 3386 | + |
| 3387 | +function removeHighlight(el, highlightColor) { |
| 3388 | + el.classList.remove("respec-hl", highlightColor); |
| 3389 | + // clean up empty class attributes so they don't come in export |
| 3390 | + if (!el.classList.length) el.removeAttribute("class"); |
| 3391 | +} |
| 3392 | + |
| 3393 | +function addHighlight(elem, highlightColor) { |
| 3394 | + elem.classList.add("respec-hl", highlightColor); |
| 3395 | +} |
| 3396 | + |
| 3397 | +/** |
| 3398 | + * Same as `norm` from src/core/utils, but our build process doesn't allow |
| 3399 | + * imports in runtime scripts, so duplicated here. |
| 3400 | + * @param {string} str |
| 3401 | + */ |
| 3402 | +function norm(str) { |
| 3403 | + return str.trim().replace(/\s+/g, " "); |
| 3404 | +} |
| 3405 | +})()</script><script id="respec-dfn-panel">(() => { |
3287 | 3406 | // @ts-check |
3288 | 3407 | if (document.respec) { |
3289 | 3408 | document.respec.ready.then(setupPanel); |
|
0 commit comments