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

@@ -33,14 +33,11 @@ The system is built up when Swagger-UI is called by iterating through ("compilin
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
const MyPreset = [FirstPlugin, SecondPlugin, ThirdPlugin]
SwaggerUI({
presets: [
[FirstPlugin, SecondPlugin],
[ThirdPlugin, FourthPlugin]
],
plugins: [
FifthPlugin,
SixthPlugin
MyPreset
]
})
```
@@ -56,6 +53,8 @@ SwaggerUI({
})
```
The need to provide the `apis` preset when adding other presets is an artifact of Swagger-UI's original design, and will likely be removed in the next major version.
### getComponent
`getComponent` is a helper function injected into every container component, which is used to get references to components provided by the plugin system.