Merge branch 'master' into issue-1334

* master: (50 commits)
  update NoErrorsPlugin to NoEmitOnErrorsPlugin
  Undo change to `swagger-client` dependency
  trigger setScheme when a new set of schemes come in
  fix eslint issues
  pin yams version
  update dist
  revert dependencies
  minify bundle css
  migrate webpack to v2.6.1
  #3110 - Fix models down arrow icon in firefox
  Fixes #3299 - export validateNumber and validateInteger for easy reuse and testing. Broke validateParam required check onto multiple lines. Added tests for validateNumber, validateInteger, and validateParam
  Improve README with more information about `urls`
  Rename variable: "selectedName" -> "primaryName"
  "name" -> "urls.primaryName"
  Update selectedIndex when a new URL is loaded
  Use select value to avoid react warning
  Properly added name config Now access it through getConfigs Documented it in README
  Add displayRequestDuration configuration option.
  Fix for #2947 - Display property names for non-object models
  #3256 - Remove unnecessary JSON.stringify call on example values that are already strings
  ...

# Conflicts:
#	dist/swagger-ui-bundle.js
#	dist/swagger-ui-bundle.js.map
#	dist/swagger-ui-standalone-preset.js
#	dist/swagger-ui-standalone-preset.js.map
#	dist/swagger-ui.css
#	dist/swagger-ui.css.map
#	dist/swagger-ui.js
#	dist/swagger-ui.js.map
#	make-webpack-config.js
#	package.json
#	webpack-dist.config.js
#	webpack-hot-dev-server.config.js
This commit is contained in:
RVKen
2017-06-30 23:24:43 +02:00
68 changed files with 690 additions and 207 deletions

View File

@@ -6,6 +6,8 @@
**This is the new version of swagger-ui, 3.x. Want to learn more? Check out our [FAQ](http://swagger.io/new-ui-faq/).**
**👉🏼 Want to score an easy open-source contribution?** Check out our [Good first contribution](https://github.com/swagger-api/swagger-ui/issues?q=is%3Aissue+is%3Aopen+label%3A%22Good+first+contribution%22) label.
As a brand new version, written from the ground up, there are some known issues and unimplemented features. Check out the [Known Issues](#known-issues) section for more details.
This repo publishes to two different NPM packages:
@@ -20,7 +22,7 @@ The OpenAPI Specification has undergone 4 revisions since initial creation in 20
Swagger UI Version | Release Date | OpenAPI Spec compatibility | Notes | Status
------------------ | ------------ | -------------------------- | ----- | ------
3.0.16 | 2017-06-17 | 2.0 | [tag v3.0.16](https://github.com/swagger-api/swagger-ui/tree/v3.0.16) |
3.0.17 | 2017-06-23 | 2.0 | [tag v3.0.17](https://github.com/swagger-api/swagger-ui/tree/v3.0.17) |
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) |
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) |
2.0.24 | 2014-09-12 | 1.1, 1.2 | [tag v2.0.24](https://github.com/swagger-api/swagger-ui/tree/v2.0.24) |
@@ -131,9 +133,13 @@ If you'd like to use the bundle files via npm, check out the [`swagger-ui-dist`
#### Parameters
Parameters with dots in their names are single strings used to organize subordinate parameters, and are not indicative of a nested structure.
Parameter Name | Description
--- | ---
url | The url pointing to API definition (normally `swagger.json` or `swagger.yaml`).
url | The url pointing to API definition (normally `swagger.json` or `swagger.yaml`). Will be ignored if `urls` or `spec` is used.
urls | An array of API definition objects (`{url: "<url>", name: "<name>"}`) used by Topbar plugin. When used and Topbar plugin is enabled, the `url` parameter will not be parsed. Names and URLs must be unique among all items in this array, since they're used as identifiers.
urls.primaryName | When using `urls`, you can use this subparameter. If the value matches the name of a spec provided in `urls`, that spec will be displayed when Swagger-UI loads, instead of defaulting to the first spec in `urls`.
spec | A JSON object describing the OpenAPI Specification. When used, the `url` parameter will not be parsed. This is useful for testing manually-generated specifications without hosting them.
validatorUrl | By default, Swagger-UI attempts to validate specs against swagger.io's online validator. You can use this parameter to set a different validator URL, for example for locally deployed validators ([Validator Badge](https://github.com/swagger-api/validator-badge)). Setting it to `null` will disable validation.
dom_id | The id of a dom element inside which SwaggerUi will put the user interface for swagger.
@@ -144,11 +150,12 @@ parameterMacro | MUST be a function. Function to set default value to parameters
modelPropertyMacro | MUST be a function. Function to set default values to each property in model. Accepts one argument modelPropertyMacro(property), property is immutable
docExpansion | Controls the default expansion setting for the operations and tags. It can be 'list' (expands only the tags), 'full' (expands the tags and operations) or 'none' (expands nothing). The default is 'list'.
displayOperationId | Controls the display of operationId in operations list. The default is `false`.
displayRequestDuration | Controls the display of the request duration (in milliseconds) for `Try it out` requests. The default is `false`.
### Plugins
#### Topbar plugin
Topbar plugin enables top bar with input for spec path and explore button. By default the plugin is enabled, and to disable it you need to remove Topbar plugin from presets in `src/standalone/index.js`:
Topbar plugin enables top bar with input for spec path and explore button or a dropdown if `urls` is used. By default the plugin is enabled, and to disable it you need to remove Topbar plugin from presets in `src/standalone/index.js`:
```
let preset = [