From c0519520815cca68632bf0ea6ec3e968d1ddad3f Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Thu, 13 Jul 2017 22:48:12 -0700 Subject: [PATCH 01/13] Use operationIds from swagger-js if available, in layout triggers --- src/core/components/operations.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/components/operations.jsx b/src/core/components/operations.jsx index 679af129..abd61fbd 100644 --- a/src/core/components/operations.jsx +++ b/src/core/components/operations.jsx @@ -80,8 +80,9 @@ export default class Operations extends React.Component { { operations.map( op => { - - const isShownKey = ["operations", op.get("id"), tag] + const operationId = + op.getIn(["operation", "__originalOperationId"]) || op.getIn(["operation", "operationId"]) || op.get("id") + const isShownKey = ["operations", operationId, tag] const path = op.get("path", "") const method = op.get("method", "") const jumpToKey = `paths.${path}.${method}` From 617cf7c86721b8fd3bacc085e95dbb4233aa008b Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Thu, 13 Jul 2017 23:24:19 -0700 Subject: [PATCH 02/13] Update URL fragment when operations & tags are shown or hidden --- src/core/plugins/deep-linking/index.js | 18 ++++++++++++ .../deep-linking/layout-wrap-actions.js | 28 +++++++++++++++++++ .../plugins/deep-linking/spec-wrap-actions.js | 0 src/core/presets/base.js | 4 ++- 4 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 src/core/plugins/deep-linking/index.js create mode 100644 src/core/plugins/deep-linking/layout-wrap-actions.js create mode 100644 src/core/plugins/deep-linking/spec-wrap-actions.js diff --git a/src/core/plugins/deep-linking/index.js b/src/core/plugins/deep-linking/index.js new file mode 100644 index 00000000..8cec4dd5 --- /dev/null +++ b/src/core/plugins/deep-linking/index.js @@ -0,0 +1,18 @@ +// import reducers from "./reducers" +// import * as actions from "./actions" +// import * as selectors from "./selectors" +import * as specWrapActions from "./spec-wrap-actions" +import * as layoutWrapActions from "./layout-wrap-actions" + +export default function() { + return { + statePlugins: { + spec: { + wrapActions: specWrapActions + }, + layout: { + wrapActions: layoutWrapActions + } + } + } +} diff --git a/src/core/plugins/deep-linking/layout-wrap-actions.js b/src/core/plugins/deep-linking/layout-wrap-actions.js new file mode 100644 index 00000000..39a2c8e8 --- /dev/null +++ b/src/core/plugins/deep-linking/layout-wrap-actions.js @@ -0,0 +1,28 @@ +export const show = (ori, system) => (...args) => { + ori(...args) + try { + let [thing, shown] = args + let [type] = thing + + if(type === "operations-tag" || type === "operations") { + if(!shown) { + return window.location.hash = "" + } + + if(type === "operations") { + let [, operationId, tag] = thing + window.location.hash = `/${tag}/${operationId}` + } + + if(type === "operations-tag") { + let [, tag] = thing + window.location.hash = `/${tag}` + } + } + + } catch(e) { + // This functionality is not mission critical, so if something goes wrong + // we'll just move on + console.error(e) + } +} diff --git a/src/core/plugins/deep-linking/spec-wrap-actions.js b/src/core/plugins/deep-linking/spec-wrap-actions.js new file mode 100644 index 00000000..e69de29b diff --git a/src/core/presets/base.js b/src/core/presets/base.js index d5471791..0043b543 100644 --- a/src/core/presets/base.js +++ b/src/core/presets/base.js @@ -10,6 +10,7 @@ import auth from "core/plugins/auth" import util from "core/plugins/util" import SplitPaneModePlugin from "core/plugins/split-pane-mode" import downloadUrlPlugin from "core/plugins/download-url" +import deepLinkingPlugin from "core/plugins/deep-linking" import App from "core/components/app" import AuthorizationPopup from "core/components/auth/authorization-popup" @@ -131,6 +132,7 @@ export default function() { auth, ast, SplitPaneModePlugin, - downloadUrlPlugin + downloadUrlPlugin, + deepLinkingPlugin ] } From d7f6355d853e8db2a23adf7ebe749687ab32d487 Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Fri, 14 Jul 2017 00:08:47 -0700 Subject: [PATCH 03/13] add setHash helper --- src/core/plugins/deep-linking/helpers.js | 7 +++++++ src/core/plugins/deep-linking/layout-wrap-actions.js | 8 +++++--- 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 src/core/plugins/deep-linking/helpers.js diff --git a/src/core/plugins/deep-linking/helpers.js b/src/core/plugins/deep-linking/helpers.js new file mode 100644 index 00000000..d06bbe27 --- /dev/null +++ b/src/core/plugins/deep-linking/helpers.js @@ -0,0 +1,7 @@ +export const setHash = (value) => { + if(value) { + return history.pushState(null, null, `#${value}`) + } else { + return window.location.hash = "" + } +} diff --git a/src/core/plugins/deep-linking/layout-wrap-actions.js b/src/core/plugins/deep-linking/layout-wrap-actions.js index 39a2c8e8..ec7421c1 100644 --- a/src/core/plugins/deep-linking/layout-wrap-actions.js +++ b/src/core/plugins/deep-linking/layout-wrap-actions.js @@ -1,3 +1,5 @@ +import { setHash } from "./helpers" + export const show = (ori, system) => (...args) => { ori(...args) try { @@ -6,17 +8,17 @@ export const show = (ori, system) => (...args) => { if(type === "operations-tag" || type === "operations") { if(!shown) { - return window.location.hash = "" + return setHash("/") } if(type === "operations") { let [, operationId, tag] = thing - window.location.hash = `/${tag}/${operationId}` + setHash(`/${tag}/${operationId}`) } if(type === "operations-tag") { let [, tag] = thing - window.location.hash = `/${tag}` + setHash(`/${tag}`) } } From 79f91b2e3e675692c94840d07eed3bccf0290dcd Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Fri, 14 Jul 2017 00:19:02 -0700 Subject: [PATCH 04/13] Rearrange isShownKey to make more sense Tag then ID is closer to representing the underlying data structure --- src/core/components/operation.jsx | 2 +- src/core/components/operations.jsx | 2 +- src/core/plugins/deep-linking/layout-wrap-actions.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/components/operation.jsx b/src/core/components/operation.jsx index 52807722..08934716 100644 --- a/src/core/components/operation.jsx +++ b/src/core/components/operation.jsx @@ -152,7 +152,7 @@ export default class Operation extends PureComponent { let onChangeKey = [ path, method ] // Used to add values to _this_ operation ( indexed by path and method ) return ( -
+
{method.toUpperCase()} diff --git a/src/core/components/operations.jsx b/src/core/components/operations.jsx index abd61fbd..921429b4 100644 --- a/src/core/components/operations.jsx +++ b/src/core/components/operations.jsx @@ -82,7 +82,7 @@ export default class Operations extends React.Component { operations.map( op => { const operationId = op.getIn(["operation", "__originalOperationId"]) || op.getIn(["operation", "operationId"]) || op.get("id") - const isShownKey = ["operations", operationId, tag] + const isShownKey = ["operations", tag, operationId] const path = op.get("path", "") const method = op.get("method", "") const jumpToKey = `paths.${path}.${method}` diff --git a/src/core/plugins/deep-linking/layout-wrap-actions.js b/src/core/plugins/deep-linking/layout-wrap-actions.js index ec7421c1..a1b75d7b 100644 --- a/src/core/plugins/deep-linking/layout-wrap-actions.js +++ b/src/core/plugins/deep-linking/layout-wrap-actions.js @@ -12,7 +12,7 @@ export const show = (ori, system) => (...args) => { } if(type === "operations") { - let [, operationId, tag] = thing + let [, tag, operationId] = thing setHash(`/${tag}/${operationId}`) } From 41ecceed8792b06c3c8a7e45ded22462d0f7ac27 Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Fri, 14 Jul 2017 00:41:22 -0700 Subject: [PATCH 05/13] Rewire operation/tag DOM ids; implement hash scroll-to --- package.json | 1 + src/core/components/operations.jsx | 5 ++- .../plugins/deep-linking/spec-wrap-actions.js | 43 +++++++++++++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 895e22dd..1893dc7f 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,7 @@ "redux-logger": "*", "reselect": "2.5.3", "sanitize-html": "^1.14.1", + "scroll-to-element": "^2.0.0", "serialize-error": "2.0.0", "shallowequal": "0.2.2", "swagger-client": "3.0.17", diff --git a/src/core/components/operations.jsx b/src/core/components/operations.jsx index 921429b4..13fcd8ba 100644 --- a/src/core/components/operations.jsx +++ b/src/core/components/operations.jsx @@ -62,7 +62,10 @@ export default class Operations extends React.Component { return (
-

layoutActions.show(isShownKey, !showTag)} className={!tagDescription ? "opblock-tag no-desc" : "opblock-tag" }> +

layoutActions.show(isShownKey, !showTag)} + className={!tagDescription ? "opblock-tag no-desc" : "opblock-tag" } + id={isShownKey.join("-")}> {tag} { !tagDescription ? null : diff --git a/src/core/plugins/deep-linking/spec-wrap-actions.js b/src/core/plugins/deep-linking/spec-wrap-actions.js index e69de29b..fc2580e5 100644 --- a/src/core/plugins/deep-linking/spec-wrap-actions.js +++ b/src/core/plugins/deep-linking/spec-wrap-actions.js @@ -0,0 +1,43 @@ +import scrollTo from "scroll-to-element" + +const SCROLL_OFFSET = -5 +let hasHashBeenParsed = false + + +export const updateResolved = (ori, { layoutActions }) => (...args) => { + ori(...args) + + if(window.location.hash && !hasHashBeenParsed ) { + let hash = window.location.hash.slice(1) // # is first character + + if(hash[0] === "!") { + // Parse UI 2.x shebangs + hash = hash.slice(1) + } + + if(hash[0] === "/") { + // "/pet/addPet" => "pet/addPet" + // makes the split result cleaner + // also handles forgotten leading slash + hash = hash.slice(1) + } + + let [tag, operationId] = hash.split("/") + + if(tag && operationId) { + // Pre-expand and scroll to the operation + scrollTo(`#operations-${tag}-${operationId}`, { + offset: SCROLL_OFFSET + }) + layoutActions.show(["operations", tag, operationId], true) + } else if(tag) { + // Pre-expand and scroll to the tag + scrollTo(`#operations-tag-${tag}`, { + offset: SCROLL_OFFSET + }) + layoutActions.show(["operations-tag", tag], true) + } + } + + hasHashBeenParsed = true +} From 8851b138f96ea016787b0dbe8071ee2c60276d3e Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Fri, 14 Jul 2017 00:51:26 -0700 Subject: [PATCH 06/13] Add config switch for deep linking --- src/core/index.js | 2 ++ src/core/plugins/deep-linking/layout-wrap-actions.js | 8 +++++++- src/core/plugins/deep-linking/spec-wrap-actions.js | 7 ++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/core/index.js b/src/core/index.js index fa5db888..f624ea34 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -30,6 +30,7 @@ const CONFIGS = [ "parameterMacro", "displayOperationId", "displayRequestDuration", + "deepLinking", ] // eslint-disable-next-line no-undef @@ -61,6 +62,7 @@ module.exports = function SwaggerUI(opts) { custom: {}, displayOperationId: false, displayRequestDuration: false, + deepLinking: true, // Initial set of plugins ( TODO rename this, or refactor - we don't need presets _and_ plugins. Its just there for performance. // Instead, we can compile the first plugin ( it can be a collection of plugins ), then batch the rest. diff --git a/src/core/plugins/deep-linking/layout-wrap-actions.js b/src/core/plugins/deep-linking/layout-wrap-actions.js index a1b75d7b..72d98948 100644 --- a/src/core/plugins/deep-linking/layout-wrap-actions.js +++ b/src/core/plugins/deep-linking/layout-wrap-actions.js @@ -1,7 +1,13 @@ import { setHash } from "./helpers" -export const show = (ori, system) => (...args) => { +export const show = (ori, { getConfigs }) => (...args) => { ori(...args) + + const isDeepLinkingEnabled = getConfigs().deepLinking + if(!isDeepLinkingEnabled || isDeepLinkingEnabled === "false") { + return + } + try { let [thing, shown] = args let [type] = thing diff --git a/src/core/plugins/deep-linking/spec-wrap-actions.js b/src/core/plugins/deep-linking/spec-wrap-actions.js index fc2580e5..9d9b2847 100644 --- a/src/core/plugins/deep-linking/spec-wrap-actions.js +++ b/src/core/plugins/deep-linking/spec-wrap-actions.js @@ -4,9 +4,14 @@ const SCROLL_OFFSET = -5 let hasHashBeenParsed = false -export const updateResolved = (ori, { layoutActions }) => (...args) => { +export const updateResolved = (ori, { layoutActions, getConfigs }) => (...args) => { ori(...args) + const isDeepLinkingEnabled = getConfigs().deepLinking + if(!isDeepLinkingEnabled || isDeepLinkingEnabled === "false") { + return + } + if(window.location.hash && !hasHashBeenParsed ) { let hash = window.location.hash.slice(1) // # is first character From 73845907a3fcf58c2c297ad9cec0f96a009f733f Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Fri, 14 Jul 2017 01:13:30 -0700 Subject: [PATCH 07/13] Add anchors for tags and operations --- src/core/components/operation.jsx | 15 ++++++++++----- src/core/components/operations.jsx | 7 ++++++- src/style/_layout.scss | 13 +++++++++++++ 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/src/core/components/operation.jsx b/src/core/components/operation.jsx index 08934716..44321e25 100644 --- a/src/core/components/operation.jsx +++ b/src/core/components/operation.jsx @@ -154,11 +154,16 @@ export default class Operation extends PureComponent { return (
- {method.toUpperCase()} - - {path} - - + {method.toUpperCase()} + + e.preventDefault()} + href={`#/${isShownKey[1]}/${isShownKey[2]}`} > + {path} + + + { !showSummary ? null :
diff --git a/src/core/components/operations.jsx b/src/core/components/operations.jsx index 13fcd8ba..20f67418 100644 --- a/src/core/components/operations.jsx +++ b/src/core/components/operations.jsx @@ -66,7 +66,12 @@ export default class Operations extends React.Component { onClick={() => layoutActions.show(isShownKey, !showTag)} className={!tagDescription ? "opblock-tag no-desc" : "opblock-tag" } id={isShownKey.join("-")}> - {tag} + e.preventDefault()} + href={`#/${tag}`}> + {tag} + { !tagDescription ? null : { tagDescription } diff --git a/src/style/_layout.scss b/src/style/_layout.scss index 78e09249..dab425d9 100644 --- a/src/style/_layout.scss +++ b/src/style/_layout.scss @@ -632,3 +632,16 @@ section @include text_headline(); } } + +a.nostyle { + text-decoration: inherit; + color: inherit; + cursor: auto; + display: inline; + + &:visited { + text-decoration: inherit; + color: inherit; + cursor: auto; + } +} From 556e40e6d45c834c05a4c1af79c592d6bfa00cd2 Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Fri, 14 Jul 2017 01:50:49 -0700 Subject: [PATCH 08/13] Don't place fragment links if deep linking is disabled --- src/core/components/operation.jsx | 9 +++++++-- src/core/components/operations.jsx | 12 ++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/core/components/operation.jsx b/src/core/components/operation.jsx index 44321e25..a8b975f8 100644 --- a/src/core/components/operation.jsx +++ b/src/core/components/operation.jsx @@ -116,7 +116,8 @@ export default class Operation extends PureComponent { specActions, specSelectors, authActions, - authSelectors + authSelectors, + getConfigs } = this.props let summary = operation.get("summary") @@ -141,6 +142,10 @@ export default class Operation extends PureComponent { const Markdown = getComponent( "Markdown" ) const Schemes = getComponent( "schemes" ) + const { deepLinking } = getConfigs() + + const isDeepLinkingEnabled = deepLinking && deepLinking !== "false" + // Merge in Live Response if(response && response.size > 0) { let notDocumented = !responses.get(String(response.get("status"))) @@ -159,7 +164,7 @@ export default class Operation extends PureComponent { e.preventDefault()} - href={`#/${isShownKey[1]}/${isShownKey[2]}`} > + href={ isDeepLinkingEnabled ? `#/${isShownKey[1]}/${isShownKey[2]}` : ""} > {path} diff --git a/src/core/components/operations.jsx b/src/core/components/operations.jsx index 20f67418..21e0e7ba 100644 --- a/src/core/components/operations.jsx +++ b/src/core/components/operations.jsx @@ -33,7 +33,15 @@ export default class Operations extends React.Component { const Collapse = getComponent("Collapse") let showSummary = layoutSelectors.showSummary() - let { docExpansion, displayOperationId, displayRequestDuration, maxDisplayedTags } = getConfigs() + let { + docExpansion, + displayOperationId, + displayRequestDuration, + maxDisplayedTags, + deepLinking + } = getConfigs() + + const isDeepLinkingEnabled = deepLinking && deepLinking !== "false" let filter = layoutSelectors.currentFilter() @@ -69,7 +77,7 @@ export default class Operations extends React.Component { e.preventDefault()} - href={`#/${tag}`}> + href={ isDeepLinkingEnabled ? `#/${tag}` : ""}> {tag} { !tagDescription ? null : From 2906bdd699e53cf280d3802e2aee9f4252cbad31 Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Fri, 14 Jul 2017 02:45:40 -0700 Subject: [PATCH 09/13] Fire layout updates before attempting to scroll (improves docExpansion:none support) --- src/core/plugins/deep-linking/spec-wrap-actions.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/plugins/deep-linking/spec-wrap-actions.js b/src/core/plugins/deep-linking/spec-wrap-actions.js index 9d9b2847..bb13a6ff 100644 --- a/src/core/plugins/deep-linking/spec-wrap-actions.js +++ b/src/core/plugins/deep-linking/spec-wrap-actions.js @@ -31,16 +31,19 @@ export const updateResolved = (ori, { layoutActions, getConfigs }) => (...args) if(tag && operationId) { // Pre-expand and scroll to the operation + layoutActions.show(["operations-tag", tag], true) + layoutActions.show(["operations", tag, operationId], true) + scrollTo(`#operations-${tag}-${operationId}`, { offset: SCROLL_OFFSET }) - layoutActions.show(["operations", tag, operationId], true) } else if(tag) { // Pre-expand and scroll to the tag + layoutActions.show(["operations-tag", tag], true) + scrollTo(`#operations-tag-${tag}`, { offset: SCROLL_OFFSET }) - layoutActions.show(["operations-tag", tag], true) } } From 66cb3ff2c00ae208220cc987550b74b9eea3b332 Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Fri, 14 Jul 2017 03:17:57 -0700 Subject: [PATCH 10/13] Use swagger-client opId helper to generate layout keys for operations --- src/core/components/operations.jsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/core/components/operations.jsx b/src/core/components/operations.jsx index 21e0e7ba..c9031651 100644 --- a/src/core/components/operations.jsx +++ b/src/core/components/operations.jsx @@ -1,5 +1,8 @@ import React from "react" import PropTypes from "prop-types" +import { helpers } from "swagger-client" + +const { opId } = helpers export default class Operations extends React.Component { @@ -96,13 +99,15 @@ export default class Operations extends React.Component { { operations.map( op => { - const operationId = - op.getIn(["operation", "__originalOperationId"]) || op.getIn(["operation", "operationId"]) || op.get("id") - const isShownKey = ["operations", tag, operationId] + const path = op.get("path", "") const method = op.get("method", "") const jumpToKey = `paths.${path}.${method}` + const operationId = + op.getIn(["operation", "operationId"]) || op.getIn(["operation", "__originalOperationId"]) || opId(op.get("operation"), path, method) || op.get("id") + const isShownKey = ["operations", tag, operationId] + const allowTryItOut = specSelectors.allowTryItOutFor(op.get("path"), op.get("method")) const response = specSelectors.responseFor(op.get("path"), op.get("method")) const request = specSelectors.requestFor(op.get("path"), op.get("method")) From 11c34d0348e8610f80d844a7c6065720a15ba3de Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Fri, 14 Jul 2017 03:21:40 -0700 Subject: [PATCH 11/13] Add docs --- docs/deep-linking.md | 34 +++++++++++++++++++++++++ src/core/plugins/deep-linking/README.md | 1 + 2 files changed, 35 insertions(+) create mode 100644 docs/deep-linking.md create mode 100644 src/core/plugins/deep-linking/README.md diff --git a/docs/deep-linking.md b/docs/deep-linking.md new file mode 100644 index 00000000..56cb3390 --- /dev/null +++ b/docs/deep-linking.md @@ -0,0 +1,34 @@ +# Deep linking + +Swagger-UI allows you to deeply link into tags and operations within a spec. When Swagger-UI is provided a URL fragment at runtime, it will automatically expand and scroll to a specified tag or operation. + +## Usage + +When you expand a tag or operation, Swagger-UI will automatically update its URL fragment with a deep link to the item. +Conversely, when you collapse a tag or operation, Swagger-UI will clear the URL fragment. + +You can also right-click a tag name or operation path in order to copy a link to that tag or operation. + +#### Fragment format + +The fragment is formatted in one of two ways: + +- `#/{tagName}`, to trigger the focus of a specific tag +- `#/{tagName}/{operationId}`, to trigger the focus of a specific operation within a tag + +`operationId` is the explicit operationId provided in the spec, if one exists. +Otherwise, Swagger-UI generates an implicit operationId by combining the operation's path and method, and escaping non-alphanumeric characters. + +## FAQ + +> I'm using Swagger-UI in an application that needs control of the URL fragment. How do I disable deep-linking? + +Pass `deepLinking: false` into Swagger-UI as a configuration item. + +> Can I link to multiple tags or operations? + +No, this is not supported. + +> Can I collapse everything except the operation or tag I'm linking to? + +Sure - use `docExpansion: none` to collapse all tags and operations. Your deep link will take precedence over the setting, so only the tag or operation you've specified will be expanded. diff --git a/src/core/plugins/deep-linking/README.md b/src/core/plugins/deep-linking/README.md new file mode 100644 index 00000000..5f417982 --- /dev/null +++ b/src/core/plugins/deep-linking/README.md @@ -0,0 +1 @@ +See `docs/deep-linking.md`. From abfad69e93892c997e72e5db344ef705fd04ccf2 Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Fri, 14 Jul 2017 16:17:41 -0700 Subject: [PATCH 12/13] Disable deep linking by default --- docs/deep-linking.md | 4 +++- src/core/index.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/deep-linking.md b/docs/deep-linking.md index 56cb3390..8fd45497 100644 --- a/docs/deep-linking.md +++ b/docs/deep-linking.md @@ -4,6 +4,8 @@ Swagger-UI allows you to deeply link into tags and operations within a spec. Whe ## Usage +👉🏼 Add `deepLinking: true` to your Swagger-UI configuration to enable this functionality. + When you expand a tag or operation, Swagger-UI will automatically update its URL fragment with a deep link to the item. Conversely, when you collapse a tag or operation, Swagger-UI will clear the URL fragment. @@ -23,7 +25,7 @@ Otherwise, Swagger-UI generates an implicit operationId by combining the operati > I'm using Swagger-UI in an application that needs control of the URL fragment. How do I disable deep-linking? -Pass `deepLinking: false` into Swagger-UI as a configuration item. +This functionality is disabled by default, but you can pass `deepLinking: false` into Swagger-UI as a configuration item to be sure. > Can I link to multiple tags or operations? diff --git a/src/core/index.js b/src/core/index.js index f624ea34..c0ba97c8 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -62,7 +62,7 @@ module.exports = function SwaggerUI(opts) { custom: {}, displayOperationId: false, displayRequestDuration: false, - deepLinking: true, + deepLinking: false, // Initial set of plugins ( TODO rename this, or refactor - we don't need presets _and_ plugins. Its just there for performance. // Instead, we can compile the first plugin ( it can be a collection of plugins ), then batch the rest. From 449a7b0023a2960d318a792e2381c50022b9a8f0 Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Fri, 14 Jul 2017 16:36:59 -0700 Subject: [PATCH 13/13] Remove Shebang functionality from Known Issues --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 3ba6b44e..560dfed3 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,6 @@ To help with the migration, here are the currently known issues with 3.X. This l - Only part of the [parameters](#parameters) previously supported are available. - The JSON Form Editor is not implemented. -- Shebang URL support for operations is missing. - Support for `collectionFormat` is partial. - l10n (translations) is not implemented. - Relative path support for external files is not implemented.