From 66216e8e17167e08c99cac184346361642501e9d Mon Sep 17 00:00:00 2001 From: blueswen Date: Sat, 16 Jul 2022 00:03:11 +0800 Subject: [PATCH] Fix Incompatible with --no-directory-urls bug --- CHANGELOG | 4 ++ README.md | 20 ++++----- demo-mkdocs/docs/index.md | 20 ++++----- demo-mkdocs/docs/options.md | 19 +++++---- docs/404.html | 6 +-- ...2131bdac.min.js => bundle.5e3df397.min.js} | 2 +- docs/assets/stylesheets/main.19db47b7.min.css | 1 + docs/assets/stylesheets/main.8ae2a6bc.min.css | 1 - docs/demo/build-in-multiple/index.html | 12 +++--- .../swagger-908d8886.html} | 2 +- ...er-73e228be.html => swagger-c7184bba.html} | 2 +- docs/demo/multiple/index.html | 12 +++--- .../swagger-123cadff.html} | 2 +- ...er-773a84f3.html => swagger-a71e52cc.html} | 2 +- docs/demo/static-file/index.html | 10 ++--- .../swagger-48438df1.html} | 2 +- docs/index.html | 33 ++++++--------- docs/options/index.html | 39 ++++++++---------- ...er-ecdac580.html => swagger-10164d0f.html} | 2 +- ...er-0aa67999.html => swagger-dce7e03c.html} | 2 +- docs/pet-store/index.html | 10 ++--- ...er-2770db91.html => swagger-c9a2a092.html} | 2 +- docs/sitemap.xml | 12 +++--- docs/sitemap.xml.gz | Bin 272 -> 273 bytes mkdocs_swagger_ui_tag/plugin.py | 2 +- setup.py | 2 +- 26 files changed, 107 insertions(+), 114 deletions(-) rename docs/assets/javascripts/{bundle.2131bdac.min.js => bundle.5e3df397.min.js} (67%) create mode 100644 docs/assets/stylesheets/main.19db47b7.min.css delete mode 100644 docs/assets/stylesheets/main.8ae2a6bc.min.css rename docs/demo/{multiple/swagger-75963d6f.html => build-in-multiple/swagger-908d8886.html} (96%) rename docs/demo/build-in-multiple/{swagger-73e228be.html => swagger-c7184bba.html} (97%) rename docs/demo/{static-file/swagger-1c707e14.html => multiple/swagger-123cadff.html} (96%) rename docs/demo/multiple/{swagger-773a84f3.html => swagger-a71e52cc.html} (96%) rename docs/demo/{build-in-multiple/swagger-a790076c.html => static-file/swagger-48438df1.html} (96%) rename docs/options/{swagger-ecdac580.html => swagger-10164d0f.html} (96%) rename docs/options/{swagger-0aa67999.html => swagger-dce7e03c.html} (96%) rename docs/pet-store/{swagger-2770db91.html => swagger-c9a2a092.html} (96%) diff --git a/CHANGELOG b/CHANGELOG index 9eca3e8..05c1bed 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +mkdocs-swagger-ui-tag 0.3.1 (2022-07-16) + + * Fixed #3: Incompatible with "--no-directory-urls" + mkdocs-swagger-ui-tag 0.3.0 (2022-06-21) * Support Swagger UI build-in multiple OAS diff --git a/README.md b/README.md index 9242290..06ff3ca 100644 --- a/README.md +++ b/README.md @@ -57,16 +57,16 @@ A MkDocs plugin supports for add [Swagger UI](https://github.com/swagger-api/swa tryItOutEnabled: ['get', 'post'] ``` - | Options | Type | Default | Description | - |------------------------|-------------------|------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| - | background | String | "" | Swagger UI iframe body background attribute value. You can use any css value for background for example "#74b9ff" or "Gainsboro" or "" for nothing. | - | docExpansion | String | list | Controls the default expansion setting for the operations and tags. It can be "list" (expands only the tags), "full" (expands the tags and operations) or "none" (expands nothing). | - | filter | String or Boolean | False | If set, enables filtering. The top bar will show an edit box that you can use to filter the tagged operations that are shown. Can be Boolean to enable or disable, or a string, in which case filtering will be enabled using that string as the filter expression. Filtering is case sensitive matching the filter expression anywhere inside the tag. | - | syntaxHighlightTheme | String | agate | [Highlight.js](https://highlightjs.org/static/demo/) syntax coloring theme to use. It can be "agate", "arta", "monokai", "nord", "obsidian" or "tomorrow-night" | - | tryItOutEnabled | Boolean | False | Controls whether the "Try it out" section should be enabled by default. | - | oauth2RedirectUrl | String | None | OAuth redirect URL. | - | tryItOutEnabled | Array | All Http Method | Array=["get", "put", "post", "delete", "options", "head", "patch", "trace"]. List of HTTP methods that have the "Try it out" feature enabled. An empty array disables "Try it out" for all operations. This does not filter the operations from the display. | - | validatorUrl | String | "https://validator.swagger.io/validator" | By default, Swagger UI attempts to validate specs against swagger.io's online validator in multiple OAS Swagger UI. You can use this parameter to set a different validator URL, for example for locally deployed validators ([Validator Badge](https://github.com/swagger-api/validator-badge)). Setting it "none" to disable validation. | + | Options | Type | Description | + |------------------------|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | background | String | Default: "". Swagger UI iframe body background attribute value. You can use any css value for background for example "#74b9ff" or "Gainsboro" or "" for nothing. | + | docExpansion | String | Default: "list". Controls the default expansion setting for the operations and tags. It can be "list" (expands only the tags), "full" (expands the tags and operations) or "none" (expands nothing). | + | filter | String or Boolean | Default: False. If set, enables filtering. The top bar will show an edit box that you can use to filter the tagged operations that are shown. Can be Boolean to enable or disable, or a string, in which case filtering will be enabled using that string as the filter expression. Filtering is case sensitive matching the filter expression anywhere inside the tag. | + | syntaxHighlightTheme | String | Default: "agate". [Highlight.js](https://highlightjs.org/static/demo/) syntax coloring theme to use. It can be "agate", "arta", "monokai", "nord", "obsidian" or "tomorrow-night" | + | tryItOutEnabled | Boolean | Default: False. Controls whether the "Try it out" section should be enabled by default. | + | oauth2RedirectUrl | String | Default: None. OAuth redirect URL. | + | supportedSubmitMethods | Array | Default: All Http Methods. Array=["get", "put", "post", "delete", "options", "head", "patch", "trace"]. List of HTTP methods that have the "Try it out" feature enabled. An empty array disables "Try it out" for all operations. This does not filter the operations from the display. | + | validatorUrl | String | Default: "https://validator.swagger.io/validator". By default, Swagger UI attempts to validate specs against swagger.io's online validator in multiple OAS Swagger UI. You can use this parameter to set a different validator URL, for example for locally deployed validators ([Validator Badge](https://github.com/swagger-api/validator-badge)). Setting it "none" to disable validation. | ## License diff --git a/demo-mkdocs/docs/index.md b/demo-mkdocs/docs/index.md index 7f26eb6..efc8055 100644 --- a/demo-mkdocs/docs/index.md +++ b/demo-mkdocs/docs/index.md @@ -47,16 +47,16 @@ A MkDocs plugin supports for add [Swagger UI](https://github.com/swagger-api/swa background: White ``` - | Options | Type | Default | Description | - |------------------------|-------------------|------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| - | background | String | "" | Swagger UI iframe body background attribute value. You can use any css value for background for example "#74b9ff" or "Gainsboro" or "" for nothing. | - | docExpansion | String | list | Controls the default expansion setting for the operations and tags. It can be "list" (expands only the tags), "full" (expands the tags and operations) or "none" (expands nothing). | - | filter | String or Boolean | False | If set, enables filtering. The top bar will show an edit box that you can use to filter the tagged operations that are shown. Can be Boolean to enable or disable, or a string, in which case filtering will be enabled using that string as the filter expression. Filtering is case sensitive matching the filter expression anywhere inside the tag. | - | syntaxHighlightTheme | String | agate | [Highlight.js](https://highlightjs.org/static/demo/) syntax coloring theme to use. It can be "agate", "arta", "monokai", "nord", "obsidian" or "tomorrow-night" | - | tryItOutEnabled | Boolean | False | Controls whether the "Try it out" section should be enabled by default. | - | oauth2RedirectUrl | String | None | OAuth redirect URL. | - | tryItOutEnabled | Array | All Http Method | Array=["get", "put", "post", "delete", "options", "head", "patch", "trace"]. List of HTTP methods that have the "Try it out" feature enabled. An empty array disables "Try it out" for all operations. This does not filter the operations from the display. | - | validatorUrl | String | "https://validator.swagger.io/validator" | By default, Swagger UI attempts to validate specs against swagger.io's online validator in multiple OAS Swagger UI. You can use this parameter to set a different validator URL, for example for locally deployed validators ([Validator Badge](https://github.com/swagger-api/validator-badge)). Setting it "none" to disable validation. | + | Options | Type | Description | + |------------------------|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | background | String | Default: "". Swagger UI iframe body background attribute value. You can use any css value for background for example "#74b9ff" or "Gainsboro" or "" for nothing. | + | docExpansion | String | Default: "list". Controls the default expansion setting for the operations and tags. It can be "list" (expands only the tags), "full" (expands the tags and operations) or "none" (expands nothing). | + | filter | String or Boolean | Default: False. If set, enables filtering. The top bar will show an edit box that you can use to filter the tagged operations that are shown. Can be Boolean to enable or disable, or a string, in which case filtering will be enabled using that string as the filter expression. Filtering is case sensitive matching the filter expression anywhere inside the tag. | + | syntaxHighlightTheme | String | Default: "agate". [Highlight.js](https://highlightjs.org/static/demo/) syntax coloring theme to use. It can be "agate", "arta", "monokai", "nord", "obsidian" or "tomorrow-night" | + | tryItOutEnabled | Boolean | Default: False. Controls whether the "Try it out" section should be enabled by default. | + | oauth2RedirectUrl | String | Default: None. OAuth redirect URL. | + | supportedSubmitMethods | Array | Default: All Http Methods. Array=["get", "put", "post", "delete", "options", "head", "patch", "trace"]. List of HTTP methods that have the "Try it out" feature enabled. An empty array disables "Try it out" for all operations. This does not filter the operations from the display. | + | validatorUrl | String | Default: "https://validator.swagger.io/validator". By default, Swagger UI attempts to validate specs against swagger.io's online validator in multiple OAS Swagger UI. You can use this parameter to set a different validator URL, for example for locally deployed validators ([Validator Badge](https://github.com/swagger-api/validator-badge)). Setting it "none" to disable validation. | ## License diff --git a/demo-mkdocs/docs/options.md b/demo-mkdocs/docs/options.md index f3c1d34..10787a1 100644 --- a/demo-mkdocs/docs/options.md +++ b/demo-mkdocs/docs/options.md @@ -7,15 +7,16 @@ Some configurations on [Swagger UI Doc](https://swagger.io/docs/open-source-tool Supported configurations included: -| Options | Type | Default | Description | -|------------------------|-------------------|------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| docExpansion | String | list | Controls the default expansion setting for the operations and tags. It can be "list" (expands only the tags), "full" (expands the tags and operations) or "none" (expands nothing). | -| filter | String or Boolean | False | If set, enables filtering. The top bar will show an edit box that you can use to filter the tagged operations that are shown. Can be Boolean to enable or disable, or a string, in which case filtering will be enabled using that string as the filter expression. Filtering is case sensitive matching the filter expression anywhere inside the tag. | -| syntaxHighlightTheme | String | agate | [Highlight.js](https://highlightjs.org/static/demo/) syntax coloring theme to use. It can be "agate", "arta", "monokai", "nord", "obsidian" or "tomorrow-night" | -| tryItOutEnabled | Boolean | False | Controls whether the "Try it out" section should be enabled by default. | -| oauth2RedirectUrl | String | None | OAuth redirect URL. | -| supportedSubmitMethods | Array | All Http Method | Array=["get", "put", "post", "delete", "options", "head", "patch", "trace"]. List of HTTP methods that have the "Try it out" feature enabled. An empty array disables "Try it out" for all operations. This does not filter the operations from the display. | -| validatorUrl | String | "https://validator.swagger.io/validator" | By default, Swagger UI attempts to validate specs against swagger.io's online validator in multiple OAS Swagger UI. You can use this parameter to set a different validator URL, for example for locally deployed validators ([Validator Badge](https://github.com/swagger-api/validator-badge)). Setting it "none" to disable validation. | +| Options | Type | Description | +|------------------------|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| background | String | Default: "". Swagger UI iframe body background attribute value. You can use any css value for background for example "#74b9ff" or "Gainsboro" or "" for nothing. | +| docExpansion | String | Default: "list". Controls the default expansion setting for the operations and tags. It can be "list" (expands only the tags), "full" (expands the tags and operations) or "none" (expands nothing). | +| filter | String or Boolean | Default: False. If set, enables filtering. The top bar will show an edit box that you can use to filter the tagged operations that are shown. Can be Boolean to enable or disable, or a string, in which case filtering will be enabled using that string as the filter expression. Filtering is case sensitive matching the filter expression anywhere inside the tag. | +| syntaxHighlightTheme | String | Default: "agate". [Highlight.js](https://highlightjs.org/static/demo/) syntax coloring theme to use. It can be "agate", "arta", "monokai", "nord", "obsidian" or "tomorrow-night" | +| tryItOutEnabled | Boolean | Default: False. Controls whether the "Try it out" section should be enabled by default. | +| oauth2RedirectUrl | String | Default: None. OAuth redirect URL. | +| supportedSubmitMethods | Array | Default: All Http Methods. Array=["get", "put", "post", "delete", "options", "head", "patch", "trace"]. List of HTTP methods that have the "Try it out" feature enabled. An empty array disables "Try it out" for all operations. This does not filter the operations from the display. | +| validatorUrl | String | Default: "https://validator.swagger.io/validator". By default, Swagger UI attempts to validate specs against swagger.io's online validator in multiple OAS Swagger UI. You can use this parameter to set a different validator URL, for example for locally deployed validators ([Validator Badge](https://github.com/swagger-api/validator-badge)). Setting it "none" to disable validation. | ## Through plugin options diff --git a/docs/404.html b/docs/404.html index 20787a3..3994528 100644 --- a/docs/404.html +++ b/docs/404.html @@ -12,7 +12,7 @@ - + @@ -20,7 +20,7 @@ - + @@ -438,7 +438,7 @@

404 - Not found

- + diff --git a/docs/assets/javascripts/bundle.2131bdac.min.js b/docs/assets/javascripts/bundle.5e3df397.min.js similarity index 67% rename from docs/assets/javascripts/bundle.2131bdac.min.js rename to docs/assets/javascripts/bundle.5e3df397.min.js index 3a77eef..cc6533c 100644 --- a/docs/assets/javascripts/bundle.2131bdac.min.js +++ b/docs/assets/javascripts/bundle.5e3df397.min.js @@ -1,3 +1,3 @@ "use strict";(()=>{var la=Object.create;var Mr=Object.defineProperty;var ua=Object.getOwnPropertyDescriptor;var ma=Object.getOwnPropertyNames,Ut=Object.getOwnPropertySymbols,da=Object.getPrototypeOf,Lr=Object.prototype.hasOwnProperty,un=Object.prototype.propertyIsEnumerable;var ln=(e,t,r)=>t in e?Mr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,H=(e,t)=>{for(var r in t||(t={}))Lr.call(t,r)&&ln(e,r,t[r]);if(Ut)for(var r of Ut(t))un.call(t,r)&&ln(e,r,t[r]);return e};var mn=(e,t)=>{var r={};for(var n in e)Lr.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ut)for(var n of Ut(e))t.indexOf(n)<0&&un.call(e,n)&&(r[n]=e[n]);return r};var Ot=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ha=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ma(t))!Lr.call(e,o)&&o!==r&&Mr(e,o,{get:()=>t[o],enumerable:!(n=ua(t,o))||n.enumerable});return e};var nt=(e,t,r)=>(r=e!=null?la(da(e)):{},ha(t||!e||!e.__esModule?Mr(r,"default",{value:e,enumerable:!0}):r,e));var hn=Ot((Ar,dn)=>{(function(e,t){typeof Ar=="object"&&typeof dn!="undefined"?t():typeof define=="function"&&define.amd?define(t):t()})(Ar,function(){"use strict";function e(r){var n=!0,o=!1,i=null,a={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function s(M){return!!(M&&M!==document&&M.nodeName!=="HTML"&&M.nodeName!=="BODY"&&"classList"in M&&"contains"in M.classList)}function c(M){var ze=M.type,Ue=M.tagName;return!!(Ue==="INPUT"&&a[ze]&&!M.readOnly||Ue==="TEXTAREA"&&!M.readOnly||M.isContentEditable)}function p(M){M.classList.contains("focus-visible")||(M.classList.add("focus-visible"),M.setAttribute("data-focus-visible-added",""))}function f(M){!M.hasAttribute("data-focus-visible-added")||(M.classList.remove("focus-visible"),M.removeAttribute("data-focus-visible-added"))}function l(M){M.metaKey||M.altKey||M.ctrlKey||(s(r.activeElement)&&p(r.activeElement),n=!0)}function m(M){n=!1}function d(M){!s(M.target)||(n||c(M.target))&&p(M.target)}function h(M){!s(M.target)||(M.target.classList.contains("focus-visible")||M.target.hasAttribute("data-focus-visible-added"))&&(o=!0,window.clearTimeout(i),i=window.setTimeout(function(){o=!1},100),f(M.target))}function b(M){document.visibilityState==="hidden"&&(o&&(n=!0),U())}function U(){document.addEventListener("mousemove",V),document.addEventListener("mousedown",V),document.addEventListener("mouseup",V),document.addEventListener("pointermove",V),document.addEventListener("pointerdown",V),document.addEventListener("pointerup",V),document.addEventListener("touchmove",V),document.addEventListener("touchstart",V),document.addEventListener("touchend",V)}function X(){document.removeEventListener("mousemove",V),document.removeEventListener("mousedown",V),document.removeEventListener("mouseup",V),document.removeEventListener("pointermove",V),document.removeEventListener("pointerdown",V),document.removeEventListener("pointerup",V),document.removeEventListener("touchmove",V),document.removeEventListener("touchstart",V),document.removeEventListener("touchend",V)}function V(M){M.target.nodeName&&M.target.nodeName.toLowerCase()==="html"||(n=!1,X())}document.addEventListener("keydown",l,!0),document.addEventListener("mousedown",m,!0),document.addEventListener("pointerdown",m,!0),document.addEventListener("touchstart",m,!0),document.addEventListener("visibilitychange",b,!0),U(),r.addEventListener("focus",d,!0),r.addEventListener("blur",h,!0),r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host?r.host.setAttribute("data-js-focus-visible",""):r.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window!="undefined"&&typeof document!="undefined"){window.applyFocusVisiblePolyfill=e;var t;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch(r){t=document.createEvent("CustomEvent"),t.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}typeof document!="undefined"&&e(document)})});var bn=Ot(Cr=>{(function(e){var t=function(){try{return!!Symbol.iterator}catch(p){return!1}},r=t(),n=function(p){var f={next:function(){var l=p.shift();return{done:l===void 0,value:l}}};return r&&(f[Symbol.iterator]=function(){return f}),f},o=function(p){return encodeURIComponent(p).replace(/%20/g,"+")},i=function(p){return decodeURIComponent(String(p).replace(/\+/g," "))},a=function(){var p=function(l){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var m=typeof l;if(m!=="undefined")if(m==="string")l!==""&&this._fromString(l);else if(l instanceof p){var d=this;l.forEach(function(X,V){d.append(V,X)})}else if(l!==null&&m==="object")if(Object.prototype.toString.call(l)==="[object Array]")for(var h=0;hd[0]?1:0}),p._entries&&(p._entries={});for(var l=0;l1?i(d[1]):"")}})})(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:Cr);(function(e){var t=function(){try{var o=new e.URL("b","http://a");return o.pathname="c d",o.href==="http://a/c%20d"&&o.searchParams}catch(i){return!1}},r=function(){var o=e.URL,i=function(c,p){typeof c!="string"&&(c=String(c)),p&&typeof p!="string"&&(p=String(p));var f=document,l;if(p&&(e.location===void 0||p!==e.location.href)){p=p.toLowerCase(),f=document.implementation.createHTMLDocument(""),l=f.createElement("base"),l.href=p,f.head.appendChild(l);try{if(l.href.indexOf(p)!==0)throw new Error(l.href)}catch(M){throw new Error("URL unable to set base "+p+" due to "+M)}}var m=f.createElement("a");m.href=c,l&&(f.body.appendChild(m),m.href=m.href);var d=f.createElement("input");if(d.type="url",d.value=c,m.protocol===":"||!/:/.test(m.href)||!d.checkValidity()&&!p)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:m});var h=new e.URLSearchParams(this.search),b=!0,U=!0,X=this;["append","delete","set"].forEach(function(M){var ze=h[M];h[M]=function(){ze.apply(h,arguments),b&&(U=!1,X.search=h.toString(),U=!0)}}),Object.defineProperty(this,"searchParams",{value:h,enumerable:!0});var V=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==V&&(V=this.search,U&&(b=!1,this.searchParams._fromString(this.search),b=!0))}})},a=i.prototype,s=function(c){Object.defineProperty(a,c,{get:function(){return this._anchorElement[c]},set:function(p){this._anchorElement[c]=p},enumerable:!0})};["hash","host","hostname","port","protocol"].forEach(function(c){s(c)}),Object.defineProperty(a,"search",{get:function(){return this._anchorElement.search},set:function(c){this._anchorElement.search=c,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(a,{toString:{get:function(){var c=this;return function(){return c.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(c){this._anchorElement.href=c,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(c){this._anchorElement.pathname=c},enumerable:!0},origin:{get:function(){var c={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],p=this._anchorElement.port!=c&&this._anchorElement.port!=="";return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(p?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(c){},enumerable:!0},username:{get:function(){return""},set:function(c){},enumerable:!0}}),i.createObjectURL=function(c){return o.createObjectURL.apply(o,arguments)},i.revokeObjectURL=function(c){return o.revokeObjectURL.apply(o,arguments)},e.URL=i};if(t()||r(),e.location!==void 0&&!("origin"in e.location)){var n=function(){return e.location.protocol+"//"+e.location.hostname+(e.location.port?":"+e.location.port:"")};try{Object.defineProperty(e.location,"origin",{get:n,enumerable:!0})}catch(o){setInterval(function(){e.location.origin=n()},100)}}})(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:Cr)});var jn=Ot((rc,Vt)=>{var vn,gn,yn,xn,En,wn,Sn,On,Tn,Wt,kr,_n,Mn,Ln,ot,An,Cn,kn,Rn,Hn,Pn,In,$n,Dt;(function(e){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){e(r(t,r(n)))}):typeof Vt=="object"&&typeof Vt.exports=="object"?e(r(t,r(Vt.exports))):e(r(t));function r(n,o){return n!==t&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(i,a){return n[i]=o?o(i,a):a}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])};vn=function(n,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(n,o);function i(){this.constructor=n}n.prototype=o===null?Object.create(o):(i.prototype=o.prototype,new i)},gn=Object.assign||function(n){for(var o,i=1,a=arguments.length;i=0;f--)(p=n[f])&&(c=(s<3?p(c):s>3?p(o,i,c):p(o,i))||c);return s>3&&c&&Object.defineProperty(o,i,c),c},En=function(n,o){return function(i,a){o(i,a,n)}},wn=function(n,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,o)},Sn=function(n,o,i,a){function s(c){return c instanceof i?c:new i(function(p){p(c)})}return new(i||(i=Promise))(function(c,p){function f(d){try{m(a.next(d))}catch(h){p(h)}}function l(d){try{m(a.throw(d))}catch(h){p(h)}}function m(d){d.done?c(d.value):s(d.value).then(f,l)}m((a=a.apply(n,o||[])).next())})},On=function(n,o){var i={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},a,s,c,p;return p={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function f(m){return function(d){return l([m,d])}}function l(m){if(a)throw new TypeError("Generator is already executing.");for(;i;)try{if(a=1,s&&(c=m[0]&2?s.return:m[0]?s.throw||((c=s.return)&&c.call(s),0):s.next)&&!(c=c.call(s,m[1])).done)return c;switch(s=0,c&&(m=[m[0]&2,c.value]),m[0]){case 0:case 1:c=m;break;case 4:return i.label++,{value:m[1],done:!1};case 5:i.label++,s=m[1],m=[0];continue;case 7:m=i.ops.pop(),i.trys.pop();continue;default:if(c=i.trys,!(c=c.length>0&&c[c.length-1])&&(m[0]===6||m[0]===2)){i=0;continue}if(m[0]===3&&(!c||m[1]>c[0]&&m[1]=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")},kr=function(n,o){var i=typeof Symbol=="function"&&n[Symbol.iterator];if(!i)return n;var a=i.call(n),s,c=[],p;try{for(;(o===void 0||o-- >0)&&!(s=a.next()).done;)c.push(s.value)}catch(f){p={error:f}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(p)throw p.error}}return c},_n=function(){for(var n=[],o=0;o1||f(b,U)})})}function f(b,U){try{l(a[b](U))}catch(X){h(c[0][3],X)}}function l(b){b.value instanceof ot?Promise.resolve(b.value.v).then(m,d):h(c[0][2],b)}function m(b){f("next",b)}function d(b){f("throw",b)}function h(b,U){b(U),c.shift(),c.length&&f(c[0][0],c[0][1])}},Cn=function(n){var o,i;return o={},a("next"),a("throw",function(s){throw s}),a("return"),o[Symbol.iterator]=function(){return this},o;function a(s,c){o[s]=n[s]?function(p){return(i=!i)?{value:ot(n[s](p)),done:s==="return"}:c?c(p):p}:c}},kn=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=n[Symbol.asyncIterator],i;return o?o.call(n):(n=typeof Wt=="function"?Wt(n):n[Symbol.iterator](),i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i);function a(c){i[c]=n[c]&&function(p){return new Promise(function(f,l){p=n[c](p),s(f,l,p.done,p.value)})}}function s(c,p,f,l){Promise.resolve(l).then(function(m){c({value:m,done:f})},p)}},Rn=function(n,o){return Object.defineProperty?Object.defineProperty(n,"raw",{value:o}):n.raw=o,n};var r=Object.create?function(n,o){Object.defineProperty(n,"default",{enumerable:!0,value:o})}:function(n,o){n.default=o};Hn=function(n){if(n&&n.__esModule)return n;var o={};if(n!=null)for(var i in n)i!=="default"&&Object.prototype.hasOwnProperty.call(n,i)&&Dt(o,n,i);return r(o,n),o},Pn=function(n){return n&&n.__esModule?n:{default:n}},In=function(n,o,i,a){if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?n!==o||!a:!o.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(n):a?a.value:o.get(n)},$n=function(n,o,i,a,s){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?n!==o||!s:!o.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?s.call(n,i):s?s.value=i:o.set(n,i),i},e("__extends",vn),e("__assign",gn),e("__rest",yn),e("__decorate",xn),e("__param",En),e("__metadata",wn),e("__awaiter",Sn),e("__generator",On),e("__exportStar",Tn),e("__createBinding",Dt),e("__values",Wt),e("__read",kr),e("__spread",_n),e("__spreadArrays",Mn),e("__spreadArray",Ln),e("__await",ot),e("__asyncGenerator",An),e("__asyncDelegator",Cn),e("__asyncValues",kn),e("__makeTemplateObject",Rn),e("__importStar",Hn),e("__importDefault",Pn),e("__classPrivateFieldGet",In),e("__classPrivateFieldSet",$n)})});var rn=Ot(($t,tn)=>{(function(t,r){typeof $t=="object"&&typeof tn=="object"?tn.exports=r():typeof define=="function"&&define.amd?define([],r):typeof $t=="object"?$t.ClipboardJS=r():t.ClipboardJS=r()})($t,function(){return function(){var e={686:function(n,o,i){"use strict";i.d(o,{default:function(){return fa}});var a=i(279),s=i.n(a),c=i(370),p=i.n(c),f=i(817),l=i.n(f);function m(j){try{return document.execCommand(j)}catch(L){return!1}}var d=function(L){var T=l()(L);return m("cut"),T},h=d;function b(j){var L=document.documentElement.getAttribute("dir")==="rtl",T=document.createElement("textarea");T.style.fontSize="12pt",T.style.border="0",T.style.padding="0",T.style.margin="0",T.style.position="absolute",T.style[L?"right":"left"]="-9999px";var P=window.pageYOffset||document.documentElement.scrollTop;return T.style.top="".concat(P,"px"),T.setAttribute("readonly",""),T.value=j,T}var U=function(L,T){var P=b(L);T.container.appendChild(P);var $=l()(P);return m("copy"),P.remove(),$},X=function(L){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},P="";return typeof L=="string"?P=U(L,T):L instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(L==null?void 0:L.type)?P=U(L.value,T):(P=l()(L),m("copy")),P},V=X;function M(j){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?M=function(T){return typeof T}:M=function(T){return T&&typeof Symbol=="function"&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T},M(j)}var ze=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},T=L.action,P=T===void 0?"copy":T,$=L.container,Q=L.target,Ae=L.text;if(P!=="copy"&&P!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(Q!==void 0)if(Q&&M(Q)==="object"&&Q.nodeType===1){if(P==="copy"&&Q.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(P==="cut"&&(Q.hasAttribute("readonly")||Q.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(Ae)return V(Ae,{container:$});if(Q)return P==="cut"?h(Q):V(Q,{container:$})},Ue=ze;function Pe(j){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Pe=function(T){return typeof T}:Pe=function(T){return T&&typeof Symbol=="function"&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T},Pe(j)}function ra(j,L){if(!(j instanceof L))throw new TypeError("Cannot call a class as a function")}function fn(j,L){for(var T=0;T0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof $.action=="function"?$.action:this.defaultAction,this.target=typeof $.target=="function"?$.target:this.defaultTarget,this.text=typeof $.text=="function"?$.text:this.defaultText,this.container=Pe($.container)==="object"?$.container:document.body}},{key:"listenClick",value:function($){var Q=this;this.listener=p()($,"click",function(Ae){return Q.onClick(Ae)})}},{key:"onClick",value:function($){var Q=$.delegateTarget||$.currentTarget,Ae=this.action(Q)||"copy",Ft=Ue({action:Ae,container:this.container,target:this.target(Q),text:this.text(Q)});this.emit(Ft?"success":"error",{action:Ae,text:Ft,trigger:Q,clearSelection:function(){Q&&Q.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function($){return _r("action",$)}},{key:"defaultTarget",value:function($){var Q=_r("target",$);if(Q)return document.querySelector(Q)}},{key:"defaultText",value:function($){return _r("text",$)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function($){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return V($,Q)}},{key:"cut",value:function($){return h($)}},{key:"isSupported",value:function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],Q=typeof $=="string"?[$]:$,Ae=!!document.queryCommandSupported;return Q.forEach(function(Ft){Ae=Ae&&!!document.queryCommandSupported(Ft)}),Ae}}]),T}(s()),fa=pa},828:function(n){var o=9;if(typeof Element!="undefined"&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}function a(s,c){for(;s&&s.nodeType!==o;){if(typeof s.matches=="function"&&s.matches(c))return s;s=s.parentNode}}n.exports=a},438:function(n,o,i){var a=i(828);function s(f,l,m,d,h){var b=p.apply(this,arguments);return f.addEventListener(m,b,h),{destroy:function(){f.removeEventListener(m,b,h)}}}function c(f,l,m,d,h){return typeof f.addEventListener=="function"?s.apply(null,arguments):typeof m=="function"?s.bind(null,document).apply(null,arguments):(typeof f=="string"&&(f=document.querySelectorAll(f)),Array.prototype.map.call(f,function(b){return s(b,l,m,d,h)}))}function p(f,l,m,d){return function(h){h.delegateTarget=a(h.target,l),h.delegateTarget&&d.call(f,h)}}n.exports=c},879:function(n,o){o.node=function(i){return i!==void 0&&i instanceof HTMLElement&&i.nodeType===1},o.nodeList=function(i){var a=Object.prototype.toString.call(i);return i!==void 0&&(a==="[object NodeList]"||a==="[object HTMLCollection]")&&"length"in i&&(i.length===0||o.node(i[0]))},o.string=function(i){return typeof i=="string"||i instanceof String},o.fn=function(i){var a=Object.prototype.toString.call(i);return a==="[object Function]"}},370:function(n,o,i){var a=i(879),s=i(438);function c(m,d,h){if(!m&&!d&&!h)throw new Error("Missing required arguments");if(!a.string(d))throw new TypeError("Second argument must be a String");if(!a.fn(h))throw new TypeError("Third argument must be a Function");if(a.node(m))return p(m,d,h);if(a.nodeList(m))return f(m,d,h);if(a.string(m))return l(m,d,h);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function p(m,d,h){return m.addEventListener(d,h),{destroy:function(){m.removeEventListener(d,h)}}}function f(m,d,h){return Array.prototype.forEach.call(m,function(b){b.addEventListener(d,h)}),{destroy:function(){Array.prototype.forEach.call(m,function(b){b.removeEventListener(d,h)})}}}function l(m,d,h){return s(document.body,m,d,h)}n.exports=c},817:function(n){function o(i){var a;if(i.nodeName==="SELECT")i.focus(),a=i.value;else if(i.nodeName==="INPUT"||i.nodeName==="TEXTAREA"){var s=i.hasAttribute("readonly");s||i.setAttribute("readonly",""),i.select(),i.setSelectionRange(0,i.value.length),s||i.removeAttribute("readonly"),a=i.value}else{i.hasAttribute("contenteditable")&&i.focus();var c=window.getSelection(),p=document.createRange();p.selectNodeContents(i),c.removeAllRanges(),c.addRange(p),a=c.toString()}return a}n.exports=o},279:function(n){function o(){}o.prototype={on:function(i,a,s){var c=this.e||(this.e={});return(c[i]||(c[i]=[])).push({fn:a,ctx:s}),this},once:function(i,a,s){var c=this;function p(){c.off(i,p),a.apply(s,arguments)}return p._=a,this.on(i,p,s)},emit:function(i){var a=[].slice.call(arguments,1),s=((this.e||(this.e={}))[i]||[]).slice(),c=0,p=s.length;for(c;c{"use strict";var $s=/["'&<>]/;Mi.exports=js;function js(e){var t=""+e,r=$s.exec(t);if(!r)return t;var n,o="",i=0,a=0;for(i=r.index;i{function e(o,i){parent.postMessage(o,i||"*")}function t(...o){return o.reduce((i,a)=>i.then(()=>new Promise(s=>{let c=document.createElement("script");c.src=a,c.addEventListener("load",()=>s()),document.body.appendChild(c)})),Promise.resolve())}function r(){let o=document.createElement("iframe");return o.width=o.height=o.frameBorder="0",o}var n=class{constructor(o,i){if(this.url=o,this.onerror=null,this.onmessage=null,this.onmessageerror=null,this.handleMessage=s=>{s.source===this.worker&&(s.stopImmediatePropagation(),this.dispatchEvent(new MessageEvent("message",{data:s.data})),this.onmessage&&this.onmessage(s))},this.handleError=(s,c,p,f,l)=>{if(c===this.url.toString()){let m=new ErrorEvent("error",{message:s,filename:c,lineno:p,colno:f,error:l});this.dispatchEvent(m),this.onerror&&this.onerror(m)}},typeof i!="undefined")throw new TypeError("Options are not supported for iframe workers");let a=new EventTarget;this.addEventListener=a.addEventListener.bind(a),this.removeEventListener=a.removeEventListener.bind(a),this.dispatchEvent=a.dispatchEvent.bind(a),document.body.appendChild(this.iframe=r()),this.worker.document.open(),this.worker.document.write(` @@ -264,7 +264,7 @@

Other independent Swagger UI

- + @@ -260,7 +260,7 @@

Swagger UI

- + @@ -258,7 +258,7 @@

Swagger UI

- + - + \ No newline at end of file diff --git a/docs/options/index.html b/docs/options/index.html index b7ffc76..b8fb70f 100644 --- a/docs/options/index.html +++ b/docs/options/index.html @@ -7,9 +7,9 @@ - + Plugin Options - MkDocs Swagger UI Tag - + @@ -229,52 +229,49 @@

Swagger UI Options

Options Type -Default Description +background +String +Default: "". Swagger UI iframe body background attribute value. You can use any css value for background for example "#74b9ff" or "Gainsboro" or "" for nothing. + + docExpansion String -list -Controls the default expansion setting for the operations and tags. It can be "list" (expands only the tags), "full" (expands the tags and operations) or "none" (expands nothing). +Default: "list". Controls the default expansion setting for the operations and tags. It can be "list" (expands only the tags), "full" (expands the tags and operations) or "none" (expands nothing). filter String or Boolean -False -If set, enables filtering. The top bar will show an edit box that you can use to filter the tagged operations that are shown. Can be Boolean to enable or disable, or a string, in which case filtering will be enabled using that string as the filter expression. Filtering is case sensitive matching the filter expression anywhere inside the tag. +Default: False. If set, enables filtering. The top bar will show an edit box that you can use to filter the tagged operations that are shown. Can be Boolean to enable or disable, or a string, in which case filtering will be enabled using that string as the filter expression. Filtering is case sensitive matching the filter expression anywhere inside the tag. syntaxHighlightTheme String -agate -Highlight.js syntax coloring theme to use. It can be "agate", "arta", "monokai", "nord", "obsidian" or "tomorrow-night" +Default: "agate". Highlight.js syntax coloring theme to use. It can be "agate", "arta", "monokai", "nord", "obsidian" or "tomorrow-night" tryItOutEnabled Boolean -False -Controls whether the "Try it out" section should be enabled by default. +Default: False. Controls whether the "Try it out" section should be enabled by default. oauth2RedirectUrl String -None -OAuth redirect URL. +Default: None. OAuth redirect URL. supportedSubmitMethods Array -All Http Method -Array=["get", "put", "post", "delete", "options", "head", "patch", "trace"]. List of HTTP methods that have the "Try it out" feature enabled. An empty array disables "Try it out" for all operations. This does not filter the operations from the display. +Default: All Http Methods. Array=["get", "put", "post", "delete", "options", "head", "patch", "trace"]. List of HTTP methods that have the "Try it out" feature enabled. An empty array disables "Try it out" for all operations. This does not filter the operations from the display. validatorUrl String -"https://validator.swagger.io/validator" -By default, Swagger UI attempts to validate specs against swagger.io's online validator in multiple OAS Swagger UI. You can use this parameter to set a different validator URL, for example for locally deployed validators (Validator Badge). Setting it "none" to disable validation. +Default: "https://validator.swagger.io/validator". By default, Swagger UI attempts to validate specs against swagger.io's online validator in multiple OAS Swagger UI. You can use this parameter to set a different validator URL, for example for locally deployed validators (Validator Badge). Setting it "none" to disable validation. @@ -289,9 +286,9 @@

Through tag attributes

<swagger-ui supportedSubmitMethods="['get']" docExpansion="none" filter="" syntaxHighlightTheme="monokai" src="./demo/openapi-spec/sample.yaml"/>
 

Swagger UI with local configurations

-

+

Swagger UI without local configurations

-

+

@@ -344,7 +341,7 @@

Swagger UI without local config
- + @@ -257,7 +257,7 @@

Swagger UI

- +