MOAR DOCS

This commit is contained in:
Kyle Shockey
2017-10-06 12:08:27 -07:00
parent f6206d35fd
commit d133f5c2df
14 changed files with 367 additions and 181 deletions

View File

@@ -1 +1,5 @@
# Swagger-UI
Welcome to the Swagger-UI documentation!
A table of contents can be found at `SUMMARY.md`.

View File

@@ -7,9 +7,9 @@
- [Version detection](usage/version-detection.md)
### Customization
- [Plugin API](customization/plugin-api.md)
- [Building an Example Plugin](customization/building-a-plugin.md)
- [Overview](customization/overview.md)
- [Creating a Custom Layout](customization/custom-layout.md)
- [Plugin API](customization/plugin-api.md)
### Development
- [Architecture overview](development/architecture.md)

View File

@@ -57,10 +57,10 @@
<link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
<link rel="next" href="../development/architecture.md" />
<link rel="next" href="plugin-api.html" />
<link rel="prev" href="building-a-plugin.html" />
<link rel="prev" href="overview.html" />
</head>
@@ -174,12 +174,12 @@
<li class="chapter " data-level="3.1" data-path="plugin-api.html">
<li class="chapter " data-level="3.1" data-path="overview.html">
<a href="plugin-api.html">
<a href="overview.html">
Plugin API
Overview
</a>
@@ -187,20 +187,7 @@
</li>
<li class="chapter " data-level="3.2" data-path="building-a-plugin.html">
<a href="building-a-plugin.html">
Building an Example Plugin
</a>
</li>
<li class="chapter active" data-level="3.3" data-path="custom-layout.html">
<li class="chapter active" data-level="3.2" data-path="custom-layout.html">
<a href="custom-layout.html">
@@ -211,6 +198,19 @@
</li>
<li class="chapter " data-level="3.3" data-path="plugin-api.html">
<a href="plugin-api.html">
Plugin API
</a>
</li>
@@ -331,12 +331,12 @@
<a href="building-a-plugin.html" class="navigation navigation-prev " aria-label="Previous page: Building an Example Plugin">
<a href="overview.html" class="navigation navigation-prev " aria-label="Previous page: Overview">
<i class="fa fa-angle-left"></i>
</a>
<a href="../development/architecture.md" class="navigation navigation-next " aria-label="Next page: Architecture overview">
<a href="plugin-api.html" class="navigation navigation-next " aria-label="Next page: Plugin API">
<i class="fa fa-angle-right"></i>
</a>
@@ -347,7 +347,7 @@
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"Creating a Custom Layout","level":"3.3","depth":1,"next":{"title":"Architecture overview","level":"4.1","depth":1,"path":"development/architecture.md","ref":"development/architecture.md","articles":[]},"previous":{"title":"Building an Example Plugin","level":"3.2","depth":1,"path":"customization/building-a-plugin.md","ref":"customization/building-a-plugin.md","articles":[]},"dir":"neutral"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"customization/custom-layout.md","mtime":"2017-10-04T02:18:03.012Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-04T01:43:58.838Z"},"basePath":"..","book":{"language":""}});
gitbook.page.hasChanged({"page":{"title":"Creating a Custom Layout","level":"3.2","depth":1,"next":{"title":"Plugin API","level":"3.3","depth":1,"path":"customization/plugin-api.md","ref":"customization/plugin-api.md","articles":[]},"previous":{"title":"Overview","level":"3.1","depth":1,"path":"customization/overview.md","ref":"customization/overview.md","articles":[]},"dir":"neutral"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"customization/custom-layout.md","mtime":"2017-10-05T23:29:46.881Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-06T04:20:18.617Z"},"basePath":"..","book":{"language":""}});
});
</script>
</div>

View File

@@ -4,7 +4,7 @@
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Building an Example Plugin · Swagger-UI</title>
<title>Overview · Swagger-UI</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="">
<meta name="generator" content="GitBook 3.2.3">
@@ -60,7 +60,7 @@
<link rel="next" href="custom-layout.html" />
<link rel="prev" href="plugin-api.html" />
<link rel="prev" href="../usage/version-detection.html" />
</head>
@@ -174,12 +174,12 @@
<li class="chapter " data-level="3.1" data-path="plugin-api.html">
<li class="chapter active" data-level="3.1" data-path="overview.html">
<a href="plugin-api.html">
<a href="overview.html">
Plugin API
Overview
</a>
@@ -187,20 +187,7 @@
</li>
<li class="chapter active" data-level="3.2" data-path="building-a-plugin.html">
<a href="building-a-plugin.html">
Building an Example Plugin
</a>
</li>
<li class="chapter " data-level="3.3" data-path="custom-layout.html">
<li class="chapter " data-level="3.2" data-path="custom-layout.html">
<a href="custom-layout.html">
@@ -211,6 +198,19 @@
</li>
<li class="chapter " data-level="3.3" data-path="plugin-api.html">
<a href="plugin-api.html">
Plugin API
</a>
</li>
@@ -289,7 +289,7 @@
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href=".." >Building an Example Plugin</a>
<a href=".." >Overview</a>
</h1>
</div>
@@ -304,7 +304,48 @@
<section class="normal markdown-section">
<h1 id="plugin-system-overview">Plugin system overview</h1>
<h3 id="prior-art">Prior art</h3>
<p>Swagger-UI leans heavily on concepts and patterns found in React and Redux.</p>
<p>If you aren&apos;t already familiar, here&apos;s some suggested reading:</p>
<ul>
<li><a href="https://reactjs.org/docs/hello-world.html" target="_blank">React: Quick Start</a></li>
<li><a href="http://redux.js.org/" target="_blank">Redux README</a></li>
</ul>
<p>In the following documentation, we won&apos;t take the time to define the fundamentals covered in the resources above.</p>
<h3 id="the-system">The System</h3>
<p>The <em>system</em> is the heart of the Swagger-UI application. At runtime, it&apos;s a JavaScript object that holds many things:</p>
<ul>
<li>React components</li>
<li>Bound Redux actions and reducers</li>
<li>Bound Reselect state selectors</li>
<li>System-wide collection of available components</li>
<li>Built-in helpers like <code>getComponent</code>, <code>makeMappedContainer</code>, and <code>getStore</code></li>
<li>User-defined helper functions</li>
</ul>
<p>The system is built up when Swagger-UI is called by iterating through (&quot;compiling&quot;) each plugin that Swagger-UI has been given, through the <code>presets</code> and <code>plugins</code> configuration options.</p>
<h3 id="presets">Presets</h3>
<p>Presets are arrays of plugins, which are provided to Swagger-UI through the <code>presets</code> configuration option. All plugins within presets are compiled before any plugins provided via the <code>plugins</code> configuration option. Consider the following example:</p>
<pre><code class="lang-javascript">SwaggerUI({
presets: [
[FirstPlugin, SecondPlugin],
[ThirdPlugin, FourthPlugin]
],
plugins: [
FifthPlugin,
SixthPlugin
]
})
</code></pre>
<p>By default, Swagger-UI includes the internal <code>ApisPreset</code>, which contains a set of plugins that provide baseline functionality for Swagger-UI. If you specify your own <code>presets</code> option, you need to add the ApisPreset manually, like so:</p>
<pre><code class="lang-javascript">SwaggerUI({
presets: [
SwaggerUI.presets.apis,
MyAmazingCustomPreset
]
})
</code></pre>
</section>
@@ -331,7 +372,7 @@
<a href="plugin-api.html" class="navigation navigation-prev " aria-label="Previous page: Plugin API">
<a href="../usage/version-detection.html" class="navigation navigation-prev " aria-label="Previous page: Version detection">
<i class="fa fa-angle-left"></i>
</a>
@@ -347,7 +388,7 @@
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"Building an Example Plugin","level":"3.2","depth":1,"next":{"title":"Creating a Custom Layout","level":"3.3","depth":1,"path":"customization/custom-layout.md","ref":"customization/custom-layout.md","articles":[]},"previous":{"title":"Plugin API","level":"3.1","depth":1,"path":"customization/plugin-api.md","ref":"customization/plugin-api.md","articles":[]},"dir":"neutral"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"customization/building-a-plugin.md","mtime":"2017-10-04T02:17:32.392Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-04T01:43:58.838Z"},"basePath":"..","book":{"language":""}});
gitbook.page.hasChanged({"page":{"title":"Overview","level":"3.1","depth":1,"next":{"title":"Creating a Custom Layout","level":"3.2","depth":1,"path":"customization/custom-layout.md","ref":"customization/custom-layout.md","articles":[]},"previous":{"title":"Version detection","level":"2.3","depth":1,"path":"usage/version-detection.md","ref":"usage/version-detection.md","articles":[]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"customization/overview.md","mtime":"2017-10-06T07:15:00.038Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-06T04:20:18.617Z"},"basePath":"..","book":{"language":""}});
});
</script>
</div>

View File

@@ -57,10 +57,10 @@
<link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
<link rel="next" href="building-a-plugin.html" />
<link rel="next" href="../development/architecture.md" />
<link rel="prev" href="../usage/version-detection.html" />
<link rel="prev" href="custom-layout.html" />
</head>
@@ -174,12 +174,12 @@
<li class="chapter active" data-level="3.1" data-path="plugin-api.html">
<li class="chapter " data-level="3.1" data-path="overview.html">
<a href="plugin-api.html">
<a href="overview.html">
Plugin API
Overview
</a>
@@ -187,20 +187,7 @@
</li>
<li class="chapter " data-level="3.2" data-path="building-a-plugin.html">
<a href="building-a-plugin.html">
Building an Example Plugin
</a>
</li>
<li class="chapter " data-level="3.3" data-path="custom-layout.html">
<li class="chapter " data-level="3.2" data-path="custom-layout.html">
<a href="custom-layout.html">
@@ -211,6 +198,19 @@
</li>
<li class="chapter active" data-level="3.3" data-path="plugin-api.html">
<a href="plugin-api.html">
Plugin API
</a>
</li>
@@ -304,13 +304,13 @@
<section class="normal markdown-section">
<h1 id="plugin-api">Plugin API</h1>
<p>A plugin is an object that contains functions and components capable of modifying and augmenting Swagger-UI&apos;s functionality.</p>
<h1 id="plugins">Plugins</h1>
<p>A plugin is a function that returns an object - more specifically, the object may contain functions and components that augment and modify Swagger-UI&apos;s functionality.</p>
<h3 id="format">Format</h3>
<p>A plugin may contain any or all of these keys:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> MyPlugin = {
<p>A plugin return value may contain any of these keys, where <code>myStateKey</code> is a name for a piece of state:</p>
<pre><code class="lang-javascript">{
statePlugins: {
anyStateKey: {
myStateKey: {
actions,
reducers,
selectors,
@@ -318,22 +318,59 @@
wrapSelectors
}
},
components: {
},
wrapComponents: {
components: {},
wrapComponents: {},
fn: {}
}
</code></pre>
<h3 id="inputs">Inputs</h3>
<p>Let&apos;s assume we have a plugin, <code>NormalPlugin</code>, that exposes a <code>doStuff</code> action under the <code>normal</code> state namespace.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> ExtendingPlugin = <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">system</span>) </span>{
<span class="hljs-keyword">return</span> {
statePlugins: {
extending: {
actions: {
doExtendedThings: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">...args</span>) </span>{
<span class="hljs-comment">// you can do other things in here if you want</span>
<span class="hljs-keyword">return</span> system.normalActions.doStuff(...args)
}
}
}
}
}
}
</code></pre>
<p>As you can see, each plugin is passed a reference to the <code>system</code> being built up. As long as <code>NormalPlugin</code> is compiled before <code>ExtendingPlugin</code>, this will work without any issues.</p>
<p>There is no dependency management built into the plugin system, so if you create a plugin that relies on another, it is your responsibility to make sure that the dependent plugin is loaded <em>after</em> the plugin being depended on.</p>
<h3 id="interfaces">Interfaces</h3>
<h5 id="actions">Actions</h5>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> MyActionPlugin = () =&gt; {
<span class="hljs-keyword">return</span> {
statePlugins: {
example: {
actions: {
updateFavoriteColor: (str) =&gt; {
<span class="hljs-keyword">return</span> {
type: <span class="hljs-string">&quot;EXAMPLE_SET_FAV_COLOR&quot;</span>,
payload: str
}
}
}
}
}
}
}
</code></pre>
<p>The Action interface enables the creation of new Redux action creators within a piece of state in the Swagger-UI system.</p>
<p>This action creator function will be bound to the <code>example</code> reducer dispatcher and exposed to container components as <code>exampleActions.updateFavoriteColor</code>.</p>
<p>For more information about the concept of actions in Redux, see the <a href="http://redux.js.org/docs/basics/Actions.html" target="_blank">Redux Actions documentation</a>.</p>
<h5 id="reducers">Reducers</h5>
<h5 id="selectors">Selectors</h5>
<h5 id="components">Components</h5>
<h5 id="wrap-actions">Wrap-Actions</h5>
<h5 id="wrap-selectors">Wrap-Selectors</h5>
<h5 id="wrap-components">Wrap-Components</h5>
<h5 id="fn">fn</h5>
</section>
@@ -361,12 +398,12 @@
<a href="../usage/version-detection.html" class="navigation navigation-prev " aria-label="Previous page: Version detection">
<a href="custom-layout.html" class="navigation navigation-prev " aria-label="Previous page: Creating a Custom Layout">
<i class="fa fa-angle-left"></i>
</a>
<a href="building-a-plugin.html" class="navigation navigation-next " aria-label="Next page: Building an Example Plugin">
<a href="../development/architecture.md" class="navigation navigation-next " aria-label="Next page: Architecture overview">
<i class="fa fa-angle-right"></i>
</a>
@@ -377,7 +414,7 @@
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"Plugin API","level":"3.1","depth":1,"next":{"title":"Building an Example Plugin","level":"3.2","depth":1,"path":"customization/building-a-plugin.md","ref":"customization/building-a-plugin.md","articles":[]},"previous":{"title":"Version detection","level":"2.3","depth":1,"path":"usage/version-detection.md","ref":"usage/version-detection.md","articles":[]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"customization/plugin-api.md","mtime":"2017-10-04T02:39:02.825Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-04T01:43:58.838Z"},"basePath":"..","book":{"language":""}});
gitbook.page.hasChanged({"page":{"title":"Plugin API","level":"3.3","depth":1,"next":{"title":"Architecture overview","level":"4.1","depth":1,"path":"development/architecture.md","ref":"development/architecture.md","articles":[]},"previous":{"title":"Creating a Custom Layout","level":"3.2","depth":1,"path":"customization/custom-layout.md","ref":"customization/custom-layout.md","articles":[]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"customization/plugin-api.md","mtime":"2017-10-06T07:38:26.729Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-06T04:20:18.617Z"},"basePath":"..","book":{"language":""}});
});
</script>
</div>

View File

@@ -172,12 +172,12 @@
<li class="chapter " data-level="3.1" data-path="customization/plugin-api.html">
<li class="chapter " data-level="3.1" data-path="customization/overview.html">
<a href="customization/plugin-api.html">
<a href="customization/overview.html">
Plugin API
Overview
</a>
@@ -185,20 +185,7 @@
</li>
<li class="chapter " data-level="3.2" data-path="customization/building-a-plugin.html">
<a href="customization/building-a-plugin.html">
Building an Example Plugin
</a>
</li>
<li class="chapter " data-level="3.3" data-path="customization/custom-layout.html">
<li class="chapter " data-level="3.2" data-path="customization/custom-layout.html">
<a href="customization/custom-layout.html">
@@ -209,6 +196,19 @@
</li>
<li class="chapter " data-level="3.3" data-path="customization/plugin-api.html">
<a href="customization/plugin-api.html">
Plugin API
</a>
</li>
@@ -303,6 +303,8 @@
<section class="normal markdown-section">
<h1 id="swagger-ui">Swagger-UI</h1>
<p>Welcome to the Swagger-UI documentation!</p>
<p>A table of contents can be found at <code>SUMMARY.md</code>.</p>
</section>
@@ -342,7 +344,7 @@
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"Intro","level":"1.1","depth":1,"next":{"title":"Installation","level":"2.1","depth":1,"path":"usage/installation.md","ref":"usage/installation.md","articles":[]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"README.md","mtime":"2017-10-04T01:10:54.324Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-04T01:43:58.838Z"},"basePath":".","book":{"language":""}});
gitbook.page.hasChanged({"page":{"title":"Intro","level":"1.1","depth":1,"next":{"title":"Installation","level":"2.1","depth":1,"path":"usage/installation.md","ref":"usage/installation.md","articles":[]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"README.md","mtime":"2017-10-06T04:31:48.558Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-06T04:20:18.617Z"},"basePath":".","book":{"language":""}});
});
</script>
</div>

File diff suppressed because one or more lines are too long

View File

@@ -174,12 +174,12 @@
<li class="chapter " data-level="3.1" data-path="../customization/plugin-api.html">
<li class="chapter " data-level="3.1" data-path="../customization/overview.html">
<a href="../customization/plugin-api.html">
<a href="../customization/overview.html">
Plugin API
Overview
</a>
@@ -187,20 +187,7 @@
</li>
<li class="chapter " data-level="3.2" data-path="../customization/building-a-plugin.html">
<a href="../customization/building-a-plugin.html">
Building an Example Plugin
</a>
</li>
<li class="chapter " data-level="3.3" data-path="../customization/custom-layout.html">
<li class="chapter " data-level="3.2" data-path="../customization/custom-layout.html">
<a href="../customization/custom-layout.html">
@@ -211,6 +198,19 @@
</li>
<li class="chapter " data-level="3.3" data-path="../customization/plugin-api.html">
<a href="../customization/plugin-api.html">
Plugin API
</a>
</li>
@@ -455,7 +455,7 @@
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"Configuration","level":"2.2","depth":1,"next":{"title":"deepLinking","level":"2.2.1","depth":2,"path":"usage/deep-linking.md","ref":"usage/deep-linking.md","articles":[]},"previous":{"title":"Installation","level":"2.1","depth":1,"path":"usage/installation.md","ref":"usage/installation.md","articles":[]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"usage/configuration.md","mtime":"2017-10-04T02:48:05.530Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-04T01:43:58.838Z"},"basePath":"..","book":{"language":""}});
gitbook.page.hasChanged({"page":{"title":"Configuration","level":"2.2","depth":1,"next":{"title":"deepLinking","level":"2.2.1","depth":2,"path":"usage/deep-linking.md","ref":"usage/deep-linking.md","articles":[]},"previous":{"title":"Installation","level":"2.1","depth":1,"path":"usage/installation.md","ref":"usage/installation.md","articles":[]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"usage/configuration.md","mtime":"2017-10-05T23:29:46.882Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-06T04:20:18.617Z"},"basePath":"..","book":{"language":""}});
});
</script>
</div>

View File

@@ -174,12 +174,12 @@
<li class="chapter " data-level="3.1" data-path="../customization/plugin-api.html">
<li class="chapter " data-level="3.1" data-path="../customization/overview.html">
<a href="../customization/plugin-api.html">
<a href="../customization/overview.html">
Plugin API
Overview
</a>
@@ -187,20 +187,7 @@
</li>
<li class="chapter " data-level="3.2" data-path="../customization/building-a-plugin.html">
<a href="../customization/building-a-plugin.html">
Building an Example Plugin
</a>
</li>
<li class="chapter " data-level="3.3" data-path="../customization/custom-layout.html">
<li class="chapter " data-level="3.2" data-path="../customization/custom-layout.html">
<a href="../customization/custom-layout.html">
@@ -211,6 +198,19 @@
</li>
<li class="chapter " data-level="3.3" data-path="../customization/plugin-api.html">
<a href="../customization/plugin-api.html">
Plugin API
</a>
</li>
@@ -375,7 +375,7 @@ Otherwise, Swagger-UI generates an implicit operationId by combining the operati
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"deepLinking","level":"2.2.1","depth":2,"next":{"title":"Version detection","level":"2.3","depth":1,"path":"usage/version-detection.md","ref":"usage/version-detection.md","articles":[]},"previous":{"title":"Configuration","level":"2.2","depth":1,"path":"usage/configuration.md","ref":"usage/configuration.md","articles":[{"title":"deepLinking","level":"2.2.1","depth":2,"path":"usage/deep-linking.md","ref":"usage/deep-linking.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"usage/deep-linking.md","mtime":"2017-10-04T02:49:05.275Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-04T01:43:58.838Z"},"basePath":"..","book":{"language":""}});
gitbook.page.hasChanged({"page":{"title":"deepLinking","level":"2.2.1","depth":2,"next":{"title":"Version detection","level":"2.3","depth":1,"path":"usage/version-detection.md","ref":"usage/version-detection.md","articles":[]},"previous":{"title":"Configuration","level":"2.2","depth":1,"path":"usage/configuration.md","ref":"usage/configuration.md","articles":[{"title":"deepLinking","level":"2.2.1","depth":2,"path":"usage/deep-linking.md","ref":"usage/deep-linking.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"usage/deep-linking.md","mtime":"2017-10-05T23:29:46.882Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-06T04:20:18.617Z"},"basePath":"..","book":{"language":""}});
});
</script>
</div>

View File

@@ -174,12 +174,12 @@
<li class="chapter " data-level="3.1" data-path="../customization/plugin-api.html">
<li class="chapter " data-level="3.1" data-path="../customization/overview.html">
<a href="../customization/plugin-api.html">
<a href="../customization/overview.html">
Plugin API
Overview
</a>
@@ -187,20 +187,7 @@
</li>
<li class="chapter " data-level="3.2" data-path="../customization/building-a-plugin.html">
<a href="../customization/building-a-plugin.html">
Building an Example Plugin
</a>
</li>
<li class="chapter " data-level="3.3" data-path="../customization/custom-layout.html">
<li class="chapter " data-level="3.2" data-path="../customization/custom-layout.html">
<a href="../customization/custom-layout.html">
@@ -211,6 +198,19 @@
</li>
<li class="chapter " data-level="3.3" data-path="../customization/plugin-api.html">
<a href="../customization/plugin-api.html">
Plugin API
</a>
</li>
@@ -376,7 +376,7 @@ app.listen(<span class="hljs-number">3000</span>)
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"Installation","level":"2.1","depth":1,"next":{"title":"Configuration","level":"2.2","depth":1,"path":"usage/configuration.md","ref":"usage/configuration.md","articles":[{"title":"deepLinking","level":"2.2.1","depth":2,"path":"usage/deep-linking.md","ref":"usage/deep-linking.md","articles":[]}]},"previous":{"title":"Intro","level":"1.1","depth":1,"path":"README.md","ref":"README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"usage/installation.md","mtime":"2017-10-04T03:40:57.425Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-04T01:43:58.838Z"},"basePath":"..","book":{"language":""}});
gitbook.page.hasChanged({"page":{"title":"Installation","level":"2.1","depth":1,"next":{"title":"Configuration","level":"2.2","depth":1,"path":"usage/configuration.md","ref":"usage/configuration.md","articles":[{"title":"deepLinking","level":"2.2.1","depth":2,"path":"usage/deep-linking.md","ref":"usage/deep-linking.md","articles":[]}]},"previous":{"title":"Intro","level":"1.1","depth":1,"path":"README.md","ref":"README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"usage/installation.md","mtime":"2017-10-05T23:29:46.882Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-06T04:20:18.617Z"},"basePath":"..","book":{"language":""}});
});
</script>
</div>

View File

@@ -57,7 +57,7 @@
<link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
<link rel="next" href="../customization/plugin-api.html" />
<link rel="next" href="../customization/overview.html" />
<link rel="prev" href="deep-linking.html" />
@@ -174,12 +174,12 @@
<li class="chapter " data-level="3.1" data-path="../customization/plugin-api.html">
<li class="chapter " data-level="3.1" data-path="../customization/overview.html">
<a href="../customization/plugin-api.html">
<a href="../customization/overview.html">
Plugin API
Overview
</a>
@@ -187,20 +187,7 @@
</li>
<li class="chapter " data-level="3.2" data-path="../customization/building-a-plugin.html">
<a href="../customization/building-a-plugin.html">
Building an Example Plugin
</a>
</li>
<li class="chapter " data-level="3.3" data-path="../customization/custom-layout.html">
<li class="chapter " data-level="3.2" data-path="../customization/custom-layout.html">
<a href="../customization/custom-layout.html">
@@ -211,6 +198,19 @@
</li>
<li class="chapter " data-level="3.3" data-path="../customization/plugin-api.html">
<a href="../customization/plugin-api.html">
Plugin API
</a>
</li>
@@ -381,7 +381,7 @@
</a>
<a href="../customization/plugin-api.html" class="navigation navigation-next " aria-label="Next page: Plugin API">
<a href="../customization/overview.html" class="navigation navigation-next " aria-label="Next page: Overview">
<i class="fa fa-angle-right"></i>
</a>
@@ -392,7 +392,7 @@
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"Version detection","level":"2.3","depth":1,"next":{"title":"Plugin API","level":"3.1","depth":1,"path":"customization/plugin-api.md","ref":"customization/plugin-api.md","articles":[]},"previous":{"title":"deepLinking","level":"2.2.1","depth":2,"path":"usage/deep-linking.md","ref":"usage/deep-linking.md","articles":[]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"usage/version-detection.md","mtime":"2017-10-04T01:13:44.192Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-04T01:43:58.838Z"},"basePath":"..","book":{"language":""}});
gitbook.page.hasChanged({"page":{"title":"Version detection","level":"2.3","depth":1,"next":{"title":"Overview","level":"3.1","depth":1,"path":"customization/overview.md","ref":"customization/overview.md","articles":[]},"previous":{"title":"deepLinking","level":"2.2.1","depth":2,"path":"usage/deep-linking.md","ref":"usage/deep-linking.md","articles":[]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"usage/version-detection.md","mtime":"2017-10-05T23:29:46.883Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-06T04:20:18.617Z"},"basePath":"..","book":{"language":""}});
});
</script>
</div>

View File

@@ -0,0 +1,53 @@
# Plugin system overview
### Prior art
Swagger-UI leans heavily on concepts and patterns found in React and Redux.
If you aren't already familiar, here's some suggested reading:
- [React: Quick Start](https://reactjs.org/docs/hello-world.html)
- [Redux README](http://redux.js.org/)
In the following documentation, we won't take the time to define the fundamentals covered in the resources above.
### The System
The _system_ is the heart of the Swagger-UI application. At runtime, it's a JavaScript object that holds many things:
- React components
- Bound Redux actions and reducers
- Bound Reselect state selectors
- System-wide collection of available components
- Built-in helpers like `getComponent`, `makeMappedContainer`, and `getStore`
- User-defined helper functions
The system is built up when Swagger-UI is called by iterating through ("compiling") each plugin that Swagger-UI has been given, through the `presets` and `plugins` configuration options.
### Presets
Presets are arrays of plugins, which are provided to Swagger-UI through the `presets` configuration option. All plugins within presets are compiled before any plugins provided via the `plugins` configuration option. Consider the following example:
```javascript
SwaggerUI({
presets: [
[FirstPlugin, SecondPlugin],
[ThirdPlugin, FourthPlugin]
],
plugins: [
FifthPlugin,
SixthPlugin
]
})
```
By default, Swagger-UI includes the internal `ApisPreset`, which contains a set of plugins that provide baseline functionality for Swagger-UI. If you specify your own `presets` option, you need to add the ApisPreset manually, like so:
```javascript
SwaggerUI({
presets: [
SwaggerUI.presets.apis,
MyAmazingCustomPreset
]
})
```

View File

@@ -1,15 +1,15 @@
# Plugin API
# Plugins
A plugin is an object that contains functions and components capable of modifying and augmenting Swagger-UI's functionality.
A plugin is a function that returns an object - more specifically, the object may contain functions and components that augment and modify Swagger-UI's functionality.
### Format
A plugin may contain any or all of these keys:
A plugin return value may contain any of these keys, where `myStateKey` is a name for a piece of state:
```javascript
const MyPlugin = {
{
statePlugins: {
anyStateKey: {
myStateKey: {
actions,
reducers,
selectors,
@@ -17,19 +17,66 @@ const MyPlugin = {
wrapSelectors
}
},
components: {
components: {},
wrapComponents: {},
fn: {}
}
```
},
wrapComponents: {
### Inputs
Let's assume we have a plugin, `NormalPlugin`, that exposes a `doStuff` action under the `normal` state namespace.
```javascript
const ExtendingPlugin = function(system) {
return {
statePlugins: {
extending: {
actions: {
doExtendedThings: function(...args) {
// you can do other things in here if you want
return system.normalActions.doStuff(...args)
}
}
}
}
}
}
```
As you can see, each plugin is passed a reference to the `system` being built up. As long as `NormalPlugin` is compiled before `ExtendingPlugin`, this will work without any issues.
There is no dependency management built into the plugin system, so if you create a plugin that relies on another, it is your responsibility to make sure that the dependent plugin is loaded _after_ the plugin being depended on.
### Interfaces
##### Actions
```javascript
const MyActionPlugin = () => {
return {
statePlugins: {
example: {
actions: {
updateFavoriteColor: (str) => {
return {
type: "EXAMPLE_SET_FAV_COLOR",
payload: str
}
}
}
}
}
}
}
```
The Action interface enables the creation of new Redux action creators within a piece of state in the Swagger-UI system.
This action creator function will be bound to the `example` reducer dispatcher and exposed to container components as `exampleActions.updateFavoriteColor`.
For more information about the concept of actions in Redux, see the [Redux Actions documentation](http://redux.js.org/docs/basics/Actions.html).
##### Reducers
##### Selectors
@@ -41,3 +88,5 @@ const MyPlugin = {
##### Wrap-Selectors
##### Wrap-Components
##### fn