diff --git a/README.md b/README.md index 2e56cd60..6cbfb9e2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ # Swagger UI [](https://travis-ci.org/swagger-api/swagger-ui) +[](http://badge.fury.io/js/swagger-ui) + +[](https://david-dm.org/swagger-api/swagger-ui) +[](https://david-dm.org/swagger-api/swagger-ui#info=devDependencies) Swagger UI is part of the Swagger project. The Swagger project allows you to produce, visualize and consume your OWN RESTful services. No proxy or 3rd party services required. Do it your own way. @@ -86,6 +90,7 @@ swaggerUi.load(); Parameter Name | Description --- | --- url | The url pointing to `swagger.json` (Swagger 2.0) or the resource listing (earlier versions) as per [Swagger Spec](https://github.com/swagger-api/swagger-spec/). +authorizations | An authorization object to be passed to swagger-js. Setting it here will trigger inclusion of any authorization or custom signing logic when fetching the swagger description file. Note the object structure should be `{ key: AuthorizationObject }` spec | A JSON object describing the Swagger specification. When used, the `url` parameter will not be parsed. This is useful for testing manually-generated specifications without hosting them. Works for Swagger 2.0 specs only. 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. This parameter is relevant for Swagger 2.0 specs only. dom_id | The id of a dom element inside which SwaggerUi will put the user interface for swagger. @@ -166,7 +171,7 @@ You can read about CORS here: http://www.w3.org/TR/cors. There are two cases where no action is needed for CORS support: 1. swagger-ui is hosted on the same server as the application itself (same host *and* port). -2. The application is located behind a proxy that enables the requires CORS headers. This may already be covered within your organization. +2. The application is located behind a proxy that enables the required CORS headers. This may already be covered within your organization. Otherwise, CORS support needs to be enabled for: diff --git a/dist/index.html b/dist/index.html index fbec8145..a979eb46 100644 --- a/dist/index.html +++ b/dist/index.html @@ -50,7 +50,7 @@ if(typeof initOAuth == "function") { initOAuth({ clientId: "your-client-id", - clientSecret: "your-client-secret", + clientSecret: "your-client-secret-if-required", realm: "your-realms", appName: "your-app-name", scopeSeparator: "," diff --git a/dist/lang/ja.js b/dist/lang/ja.js new file mode 100755 index 00000000..3207bfc0 --- /dev/null +++ b/dist/lang/ja.js @@ -0,0 +1,53 @@ +'use strict'; + +/* jshint quotmark: double */ +window.SwaggerTranslator.learn({ + "Warning: Deprecated":"警告: 廃止予定", + "Implementation Notes":"実装メモ", + "Response Class":"レスポンスクラス", + "Status":"ステータス", + "Parameters":"パラメータ群", + "Parameter":"パラメータ", + "Value":"値", + "Description":"説明", + "Parameter Type":"パラメータタイプ", + "Data Type":"データタイプ", + "Response Messages":"レスポンスメッセージ", + "HTTP Status Code":"HTTPステータスコード", + "Reason":"理由", + "Response Model":"レスポンスモデル", + "Request URL":"リクエストURL", + "Response Body":"レスポンスボディ", + "Response Code":"レスポンスコード", + "Response Headers":"レスポンスヘッダ", + "Hide Response":"レスポンスを隠す", + "Headers":"ヘッダ", + "Try it out!":"実際に実行!", + "Show/Hide":"表示/非表示", + "List Operations":"操作一覧", + "Expand Operations":"操作の展開", + "Raw":"Raw", + "can't parse JSON. Raw result":"JSONへ解釈できません. 未加工の結果", + "Model Schema":"モデルスキーマ", + "Model":"モデル", + "apply":"実行", + "Username":"ユーザ名", + "Password":"パスワード", + "Terms of service":"サービス利用規約", + "Created by":"Created by", + "See more at":"See more at", + "Contact the developer":"開発者に連絡", + "api version":"APIバージョン", + "Response Content Type":"レスポンス コンテンツタイプ", + "fetching resource":"リソースの取得", + "fetching resource list":"リソース一覧の取得", + "Explore":"Explore", + "Show Swagger Petstore Example Apis":"SwaggerペットストアAPIの表示", + "Can't read from server. It may not have the appropriate access-control-origin settings.":"サーバから読み込めません. 適切なaccess-control-origin設定を持っていない可能性があります.", + "Please specify the protocol for":"プロトコルを指定してください", + "Can't read swagger JSON from":"次からswagger JSONを読み込めません", + "Finished Loading Resource Information. Rendering Swagger UI":"リソース情報の読み込みが完了しました. Swagger UIを描画しています", + "Unable to read api":"APIを読み込めません", + "from path":"次のパスから", + "server returned":"サーバからの返答" +}); diff --git a/dist/lib/swagger-oauth.js b/dist/lib/swagger-oauth.js index 3bb1c277..b04a45cb 100644 --- a/dist/lib/swagger-oauth.js +++ b/dist/lib/swagger-oauth.js @@ -187,7 +187,7 @@ function initOAuth(opts) { popupMask = (o.popupMask||$('#api-common-mask')); popupDialog = (o.popupDialog||$('.api-popup-dialog')); clientId = (o.clientId||errors.push('missing client id')); - clientSecret = (o.clientSecret||errors.push('missing client secret')); + clientSecret = (o.clientSecret||null); realm = (o.realm||errors.push('missing realm')); scopeSeparator = (o.scopeSeparator||' '); @@ -211,11 +211,15 @@ function initOAuth(opts) { window.processOAuthCode = function processOAuthCode(data) { var params = { 'client_id': clientId, - 'client_secret': clientSecret, 'code': data.code, 'grant_type': 'authorization_code', 'redirect_uri': redirect_uri + }; + + if (clientSecret) { + params.client_secret = clientSecret; } + $.ajax( { url : window.swaggerUi.tokenUrl, @@ -230,7 +234,7 @@ window.processOAuthCode = function processOAuthCode(data) { onOAuthComplete(""); } }); -} +}; window.onOAuthComplete = function onOAuthComplete(token) { if(token) { @@ -287,4 +291,4 @@ window.onOAuthComplete = function onOAuthComplete(token) { } } } -} +}; diff --git a/dist/swagger-ui.js b/dist/swagger-ui.js index c7fef444..d1db7d11 100644 --- a/dist/swagger-ui.js +++ b/dist/swagger-ui.js @@ -1,6 +1,6 @@ /** * swagger-ui - Swagger UI is a dependency-free collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API - * @version v2.1.3 + * @version v2.1.4 * @link http://swagger.io * @license Apache-2.0 */ @@ -487,7 +487,7 @@ this["Handlebars"]["templates"]["operation"] = Handlebars.template({"1":function if (stack1 != null) { buffer += stack1; } stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isReadOnly : depth0), {"name":"if","hash":{},"fn":this.program(22, data),"inverse":this.program(24, data),"data":data}); if (stack1 != null) { buffer += stack1; } - buffer += " \n
\n \n \n"; diff --git a/dist/swagger-ui.min.js b/dist/swagger-ui.min.js index 27776b6d..99ac3ab3 100644 --- a/dist/swagger-ui.min.js +++ b/dist/swagger-ui.min.js @@ -1,5 +1,5 @@ -(function(){function e(){e.history=e.history||[],e.history.push(arguments),this.console&&console.log(Array.prototype.slice.call(arguments)[0])}this.Handlebars=this.Handlebars||{},this.Handlebars.templates=this.Handlebars.templates||{},this.Handlebars.templates.apikey_button_view=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return"\n