From 0c00e033302e19e3754a6f5f87c861e01bb53017 Mon Sep 17 00:00:00 2001 From: Ron Date: Tue, 4 Apr 2017 10:34:22 -0700 Subject: [PATCH 1/2] Update README.md --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index 427e5d99..061bf5ba 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,35 @@ To help with the migration, here are the currently known issues with 3.X. This l - l10n (translations) is not implemented. - Relative path support for external files is not implemented. +### SwaggerUIBundle +To use swagger-ui you should take a look at the [source of swagger-ui html page](https://github.com/swagger-api/swagger-ui/blob/master/dist/index.html) and customize it. This basically requires you to instantiate a SwaggerUi object and call load() on it as below: + +```javascript + const ui = SwaggerUIBundle({ + url: "http://petstore.swagger.io/v2/swagger.json", + dom_id: '#swagger-ui', + presets: [ + SwaggerUIBundle.presets.apis, + SwaggerUIStandalonePreset + ], + plugins: [ + SwaggerUIBundle.plugins.DownloadUrl + ], + layout: "StandaloneLayout" + }) +``` + +#### Parameters + +Parameter Name | Description +--- | --- +url | The url pointing to API definition (normally `swagger.json` or `swagger.yaml`). +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. +oauth2RedirectUrl | OAuth redirect URL + + ## CORS Support From e24bc7635ff4a688da63a2111a0e1b396e9980fe Mon Sep 17 00:00:00 2001 From: Ron Date: Tue, 4 Apr 2017 10:41:22 -0700 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 061bf5ba..8858ab0a 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Swagger UI works in the latest versions of Chrome, Safari, Firefox, Edge and IE1 To help with the migration, here are the currently known issues with 3.X. This list will update regularly, and will not include features that were not implemented in previous versions. -- Currently, the only configuration options available are the `url` and `spec`. +- 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.