Skip to content

Commit 83232dc

Browse files
authored
v3.12.0 (#4282)
* Use `parameterWithMeta` to get parameter data in <ParameterRow> * Prefer specPath when fetching resolved subtrees in OperationContainer * Add test for OAS3 callback rendering * Remove debugger statement * Pass base resolution URL directly to Swagger-Client subtree resolver * Remove accidental comment * Migrate additional options * Don't default to empty Map when getting subtree * fix(validateParam): check for ImList type before using count method * Use `replaceState` to update `urls.primaryName` This gives us the stateful URL we want, without: (a) refreshing the page on update (b) creating a long, useless history for the user (c) implying that browser history is two-way bound to Swagger-UI (it isn't, we don't have a router) * Add `fn.opsFilter` docs and internal API versioning note * restrict `x-example` functionality to Swagger 2.0 * polish Authorize + Close buttons * add tachyons; use it for padding the new Reset button * v3.12.0 * rebuild dist
1 parent ad43965 commit 83232dc

File tree

18 files changed

+98
-38
lines changed

18 files changed

+98
-38
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The OpenAPI Specification has undergone 5 revisions since initial creation in 20
2222

2323
Swagger UI Version | Release Date | OpenAPI Spec compatibility | Notes
2424
------------------ | ------------ | -------------------------- | -----
25-
3.11.0 | 2018-02-09 | 2.0, 3.0 | [tag v3.11.0](https://github.com/swagger-api/swagger-ui/tree/v3.11.0)
25+
3.12.0 | 2018-03-02 | 2.0, 3.0 | [tag v3.12.0](https://github.com/swagger-api/swagger-ui/tree/v3.12.0)
2626
3.0.21 | 2017-07-26 | 2.0 | [tag v3.0.21](https://github.com/swagger-api/swagger-ui/tree/v3.0.21)
2727
2.2.10 | 2017-01-04 | 1.1, 1.2, 2.0 | [tag v2.2.10](https://github.com/swagger-api/swagger-ui/tree/v2.2.10)
2828
2.1.5 | 2016-07-20 | 1.1, 1.2, 2.0 | [tag v2.1.5](https://github.com/swagger-api/swagger-ui/tree/v2.1.5)

dist/swagger-ui-bundle.js

Lines changed: 14 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-ui-bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-ui-standalone-preset.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-ui-standalone-preset.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-ui.css

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-ui.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-ui.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/customization/plug-points.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Plug points
2+
3+
Swagger-UI exposes most of its internal logic through the plugin system.
4+
5+
Often, it is beneficial to override the core internals to achieve custom behavior.
6+
7+
### Note: Semantic Versioning
8+
9+
Swagger-UI's internal APIs are _not_ part of our public contract, which means that they can change without the major version changing.
10+
11+
If your custom plugins wrap, extend, override, or consume any internal core APIs, we recommend specifying a specific minor version of Swagger-UI to use in your application, because they will _not_ change between patch versions.
12+
13+
If you're installing Swagger-UI via NPM, for example, you can do this by using a tilde:
14+
15+
```js
16+
{
17+
"dependencies": {
18+
"swagger-ui": "~3.11.0"
19+
}
20+
}
21+
```
22+
23+
### `fn.opsFilter`
24+
25+
When using the `filter` option, tag names will be filtered by the user-provided value. If you'd like to customize this behavior, you can override the default `opsFilter` function.
26+
27+
For example, you can implement a multiple-phrase filter:
28+
29+
```js
30+
const MultiplePhraseFilterPlugin = function() {
31+
return {
32+
fn: {
33+
opsFilter: (taggedOps, phrase) => {
34+
const phrases = phrase.split(", ")
35+
36+
return taggedOps.filter((val, key) => {
37+
return phrases.some(item => key.indexOf(item) > -1)
38+
})
39+
}
40+
}
41+
}
42+
}
43+
```

docs/customization/plugin-api.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22

33
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.
44

5+
### Note: Semantic Versioning
6+
7+
Swagger-UI's internal APIs are _not_ part of our public contract, which means that they can change without the major version changing.
8+
9+
If your custom plugins wrap, extend, override, or consume any internal core APIs, we recommend specifying a specific minor version of Swagger-UI to use in your application, because they will _not_ change between patch versions.
10+
11+
If you're installing Swagger-UI via NPM, for example, you can do this by using a tilde:
12+
13+
```js
14+
{
15+
"dependencies": {
16+
"swagger-ui": "~3.11.0"
17+
}
18+
}
19+
```
20+
521
### Format
622

723
A plugin return value may contain any of these keys, where `stateKey` is a name for a piece of state:

0 commit comments

Comments
 (0)