This commit is contained in:
Kyle Shockey
2017-11-01 13:30:07 -07:00
parent e4471830f4
commit 345c8dee57
43 changed files with 29515 additions and 57 deletions

View File

@@ -0,0 +1,409 @@
<!DOCTYPE HTML>
<html lang="" >
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Version detection · Swagger-UI</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="">
<meta name="generator" content="GitBook 3.2.3">
<link rel="stylesheet" href="../gitbook/style.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
<link rel="next" href="../customization/overview.html" />
<link rel="prev" href="deep-linking.html" />
</head>
<body>
<div class="book">
<div class="book-summary">
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search" />
</div>
<nav role="navigation">
<ul class="summary">
<li class="chapter " data-level="1.1" data-path="../">
<a href="../">
Intro
</a>
</li>
<li class="header">Usage</li>
<li class="chapter " data-level="2.1" data-path="installation.html">
<a href="installation.html">
Installation
</a>
</li>
<li class="chapter " data-level="2.2" data-path="configuration.html">
<a href="configuration.html">
Configuration
</a>
<ul class="articles">
<li class="chapter " data-level="2.2.1" data-path="deep-linking.html">
<a href="deep-linking.html">
deepLinking
</a>
</li>
</ul>
</li>
<li class="chapter active" data-level="2.3" data-path="version-detection.html">
<a href="version-detection.html">
Version detection
</a>
</li>
<li class="header">Customization</li>
<li class="chapter " data-level="3.1" data-path="../customization/overview.html">
<a href="../customization/overview.html">
Overview
</a>
</li>
<li class="chapter " data-level="3.2" data-path="../customization/custom-layout.html">
<a href="../customization/custom-layout.html">
Creating a custom layout
</a>
</li>
<li class="chapter " data-level="3.3" data-path="../customization/plugin-api.html">
<a href="../customization/plugin-api.html">
Plugin API
</a>
</li>
<li class="header">Development</li>
<li class="chapter " data-level="4.1" data-path="../development/setting-up.html">
<a href="../development/setting-up.html">
Setting up a dev environment
</a>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href=".." >Version detection</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<div id="book-search-results">
<div class="search-noresults">
<section class="normal markdown-section">
<h1 id="detecting-your-swagger-ui-version">Detecting your Swagger-UI version</h1>
<p>At times, you&apos;re going to need to know which version of Swagger-UI you use.</p>
<p>The first step would be to detect which major version you currently use, as the method of detecting the version has changed. If your Swagger-UI has been heavily modified and you cannot detect from the look and feel which major version you use, you&apos;d have to try both methods to get the exact version.</p>
<p>To help you visually detect which version you&apos;re using, we&apos;ve included supporting images.</p>
<h1 id="swagger-ui-3x">Swagger-UI 3.X</h1>
<p><img src="../images/swagger-ui3.png" alt="Swagger-UI 3"></p>
<p>Some distinct identifiers to Swagger-UI 3.X:</p>
<ul>
<li>The API version appears as a badge next to its title.</li>
<li>If there are schemes or authorizations, they&apos;d appear in a bar above the operations.</li>
<li>Try it out functionality is not enabled by default.</li>
<li>All the response codes in the operations appear at after the parameters.</li>
<li>There&apos;s a models section after the operations.</li>
</ul>
<p>If you&apos;ve determined this is the version you have, to find the exact version:</p>
<ul>
<li>Open your browser&apos;s web console (changes between browsers)</li>
<li>Type <code>versions</code> in the console and execute the call.</li>
<li>You might need to expand the result, until you get a string similar to <code>swaggerUi : Object { version: &quot;3.1.6&quot;, gitRevision: &quot;g786cd47&quot;, gitDirty: true, &#x2026; }</code>.</li>
<li>The version taken from that example would be <code>3.1.6</code>.</li>
</ul>
<p>Note: This functionality was added in 3.0.8. If you&apos;re unable to execute it, you&apos;re likely to use an older version, and in that case the first step would be to upgrade.</p>
<h1 id="swagger-ui-2x-and-under">Swagger-UI 2.X and under</h1>
<p><img src="../images/swagger-ui2.png" alt="Swagger-UI 2"></p>
<p>Some distinct identifiers to Swagger-UI 3.X:</p>
<ul>
<li>The API version appears at the bottom of the page.</li>
<li>Schemes are not rendered.</li>
<li>Authorization, if rendered, will appear next to the navigation bar.</li>
<li>Try it out functionality is enabled by default.</li>
<li>The successful response code would appear above the parameters, the rest below them.</li>
<li>There&apos;s no models section after the operations.</li>
</ul>
<p>If you&apos;ve determined this is the version you have, to find the exact version:</p>
<ul>
<li>Navigate to the sources of the UI. Either on your disk or via the view page source functionality in your browser.</li>
<li>Find an open the <code>swagger-ui.js</code></li>
<li>At the top of the page, there would be a comment containing the exact version of swagger-ui. This example shows version <code>2.2.9</code>:</li>
</ul>
<pre><code>/**
* swagger-ui - Swagger UI is a dependency-free collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API
* @version v2.2.9
* @link http://swagger.io
* @license Apache-2.0
*/
</code></pre>
</section>
</div>
<div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
</div>
<a href="deep-linking.html" class="navigation navigation-prev " aria-label="Previous page: deepLinking">
<i class="fa fa-angle-left"></i>
</a>
<a href="../customization/overview.html" class="navigation navigation-next " aria-label="Next page: Overview">
<i class="fa fa-angle-right"></i>
</a>
</div>
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
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-11-01T00:00:09.668Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-11-01T03:42:59.286Z"},"basePath":"..","book":{"language":""}});
});
</script>
</div>
<script src="../gitbook/gitbook.js"></script>
<script src="../gitbook/theme.js"></script>
<script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
<script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
<script src="../gitbook/gitbook-plugin-search/search.js"></script>
<script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
<script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
<script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
<script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
</body>
</html>