You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
4
+
5
+
## Usage
6
+
7
+
👉🏼 Add `deepLinking: true` to your Swagger-UI configuration to enable this functionality.
8
+
9
+
When you expand a tag or operation, Swagger-UI will automatically update its URL fragment with a deep link to the item.
10
+
Conversely, when you collapse a tag or operation, Swagger-UI will clear the URL fragment.
11
+
12
+
You can also right-click a tag name or operation path in order to copy a link to that tag or operation.
13
+
14
+
#### Fragment format
15
+
16
+
The fragment is formatted in one of two ways:
17
+
18
+
-`#/{tagName}`, to trigger the focus of a specific tag
19
+
-`#/{tagName}/{operationId}`, to trigger the focus of a specific operation within a tag
20
+
21
+
`operationId` is the explicit operationId provided in the spec, if one exists.
22
+
Otherwise, Swagger-UI generates an implicit operationId by combining the operation's path and method, and escaping non-alphanumeric characters.
23
+
24
+
## FAQ
25
+
26
+
> I'm using Swagger-UI in an application that needs control of the URL fragment. How do I disable deep-linking?
27
+
28
+
This functionality is disabled by default, but you can pass `deepLinking: false` into Swagger-UI as a configuration item to be sure.
29
+
30
+
> Can I link to multiple tags or operations?
31
+
32
+
No, this is not supported.
33
+
34
+
> Can I collapse everything except the operation or tag I'm linking to?
35
+
36
+
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.
0 commit comments