├── .gitattributes ├── README.md ├── css ├── print.css ├── reset.css ├── screen.css ├── style.css └── typography.css ├── demo.json ├── fonts ├── droid-sans-v6-latin-700.eot ├── droid-sans-v6-latin-700.svg ├── droid-sans-v6-latin-700.ttf ├── droid-sans-v6-latin-700.woff ├── droid-sans-v6-latin-700.woff2 ├── droid-sans-v6-latin-regular.eot ├── droid-sans-v6-latin-regular.svg ├── droid-sans-v6-latin-regular.ttf ├── droid-sans-v6-latin-regular.woff └── droid-sans-v6-latin-regular.woff2 ├── images ├── explorer_icons.png ├── favicon-16x16.png ├── favicon-32x32.png ├── favicon.ico ├── logo_small.png ├── pet_store_api.png ├── throbber.gif └── wordnik_api.png ├── index.html ├── lang ├── en.js ├── translator.js └── zh-CN.js ├── lib ├── backbone-min.js ├── handlebars-2.0.0.js ├── highlight.7.3.pack.js ├── jquery-1.8.0.min.js ├── jquery.ba-bbq.min.js ├── jquery.slideto.min.js ├── jquery.wiggle.min.js ├── marked.js ├── swagger-oauth.js ├── underscore-min.js └── underscore-min.map ├── o2c.html ├── swagger-ui.js └── swagger-ui.min.js /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 汉化swagger-ui 2 | 3 | 汉化了swagger-ui,修改了部分样式 4 | 演示地址:http://helei112g.github.io/swagger-ui/#/ 5 | 6 | # 修改文件 7 | 8 | * swagger-ui.js,修改了部分js,在首页上,增加了显示api发布时间的tag 9 | * lang/zh-CN.js,在lang文件中,增加了中文语言包,其中由于部分使用英文表达更准确,未更改 10 | * index.html,修改了初始化swagger,为期增加了一个初始化加载完成后的回调 11 | * screen.css,为了显示接口创建时间,修改了部分样式 12 | 13 | # 使用方法 14 | 15 | 1. 直接clone该项目到本地,运行index.html文件,可获得我的demo样式 16 | 2. 根据自身实际情况修改demo.json文件,已完成自身api接口文档的书写 17 | 3. 如果json文件是在线的,请求改index.html文件中`url = "http://192.168.1.8/api/demo.json";`,将online url地址写在这里。 18 | 19 | # 与我交流 20 | 21 | 第一个自己的github项目,如果对有何指教,欢迎联系: 22 | 23 | e-mail:helei5200@126.com 24 | 25 | blog: http://blog.csdn.net/hel12he 26 | -------------------------------------------------------------------------------- /css/reset.css: -------------------------------------------------------------------------------- 1 | /* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 */ 2 | html, 3 | body, 4 | div, 5 | span, 6 | applet, 7 | object, 8 | iframe, 9 | h1, 10 | h2, 11 | h3, 12 | h4, 13 | h5, 14 | h6, 15 | p, 16 | blockquote, 17 | pre, 18 | a, 19 | abbr, 20 | acronym, 21 | address, 22 | big, 23 | cite, 24 | code, 25 | del, 26 | dfn, 27 | em, 28 | img, 29 | ins, 30 | kbd, 31 | q, 32 | s, 33 | samp, 34 | small, 35 | strike, 36 | strong, 37 | sub, 38 | sup, 39 | tt, 40 | var, 41 | b, 42 | u, 43 | i, 44 | center, 45 | dl, 46 | dt, 47 | dd, 48 | ol, 49 | ul, 50 | li, 51 | fieldset, 52 | form, 53 | label, 54 | legend, 55 | table, 56 | caption, 57 | tbody, 58 | tfoot, 59 | thead, 60 | tr, 61 | th, 62 | td, 63 | article, 64 | aside, 65 | canvas, 66 | details, 67 | embed, 68 | figure, 69 | figcaption, 70 | footer, 71 | header, 72 | hgroup, 73 | menu, 74 | nav, 75 | output, 76 | ruby, 77 | section, 78 | summary, 79 | time, 80 | mark, 81 | audio, 82 | video { 83 | margin: 0; 84 | padding: 0; 85 | border: 0; 86 | font-size: 100%; 87 | font: inherit; 88 | vertical-align: baseline; 89 | } 90 | /* HTML5 display-role reset for older browsers */ 91 | article, 92 | aside, 93 | details, 94 | figcaption, 95 | figure, 96 | footer, 97 | header, 98 | hgroup, 99 | menu, 100 | nav, 101 | section { 102 | display: block; 103 | } 104 | body { 105 | line-height: 1; 106 | } 107 | ol, 108 | ul { 109 | list-style: none; 110 | } 111 | blockquote, 112 | q { 113 | quotes: none; 114 | } 115 | blockquote:before, 116 | blockquote:after, 117 | q:before, 118 | q:after { 119 | content: ''; 120 | content: none; 121 | } 122 | table { 123 | border-collapse: collapse; 124 | border-spacing: 0; 125 | } 126 | -------------------------------------------------------------------------------- /css/style.css: -------------------------------------------------------------------------------- 1 | .swagger-section #header a#logo { 2 | font-size: 1.5em; 3 | font-weight: bold; 4 | text-decoration: none; 5 | background: transparent url(../images/logo.png) no-repeat left center; 6 | padding: 20px 0 20px 40px; 7 | } 8 | #text-head { 9 | font-size: 80px; 10 | font-family: 'Roboto', sans-serif; 11 | color: #ffffff; 12 | float: right; 13 | margin-right: 20%; 14 | } 15 | .navbar-fixed-top .navbar-nav { 16 | height: auto; 17 | } 18 | .navbar-fixed-top .navbar-brand { 19 | height: auto; 20 | } 21 | .navbar-header { 22 | height: auto; 23 | } 24 | .navbar-inverse { 25 | background-color: #000; 26 | border-color: #000; 27 | } 28 | #navbar-brand { 29 | margin-left: 20%; 30 | } 31 | .navtext { 32 | font-size: 10px; 33 | } 34 | .h1, 35 | h1 { 36 | font-size: 60px; 37 | } 38 | .navbar-default .navbar-header .navbar-brand { 39 | color: #a2dfee; 40 | } 41 | /* tag titles */ 42 | .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a { 43 | color: #393939; 44 | font-family: 'Arvo', serif; 45 | font-size: 1.5em; 46 | } 47 | .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover { 48 | color: black; 49 | } 50 | .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 { 51 | color: #525252; 52 | padding-left: 0px; 53 | display: block; 54 | clear: none; 55 | float: left; 56 | font-family: 'Arvo', serif; 57 | font-weight: bold; 58 | } 59 | .navbar-default .navbar-collapse, 60 | .navbar-default .navbar-form { 61 | border-color: #0A0A0A; 62 | } 63 | .container1 { 64 | width: 1500px; 65 | margin: auto; 66 | margin-top: 0; 67 | background-image: url('../images/shield.png'); 68 | background-repeat: no-repeat; 69 | background-position: -40px -20px; 70 | margin-bottom: 210px; 71 | } 72 | .container-inner { 73 | width: 1200px; 74 | margin: auto; 75 | background-color: rgba(223, 227, 228, 0.75); 76 | padding-bottom: 40px; 77 | padding-top: 40px; 78 | border-radius: 15px; 79 | } 80 | .header-content { 81 | padding: 0; 82 | width: 1000px; 83 | } 84 | .title1 { 85 | font-size: 80px; 86 | font-family: 'Vollkorn', serif; 87 | color: #404040; 88 | text-align: center; 89 | padding-top: 40px; 90 | padding-bottom: 100px; 91 | } 92 | #icon { 93 | margin-top: -18px; 94 | } 95 | .subtext { 96 | font-size: 25px; 97 | font-style: italic; 98 | color: #08b; 99 | text-align: right; 100 | padding-right: 250px; 101 | } 102 | .bg-primary { 103 | background-color: #00468b; 104 | } 105 | .navbar-default .nav > li > a, 106 | .navbar-default .nav > li > a:focus { 107 | color: #08b; 108 | } 109 | .navbar-default .nav > li > a, 110 | .navbar-default .nav > li > a:hover { 111 | color: #08b; 112 | } 113 | .navbar-default .nav > li > a, 114 | .navbar-default .nav > li > a:focus:hover { 115 | color: #08b; 116 | } 117 | .text-faded { 118 | font-size: 25px; 119 | font-family: 'Vollkorn', serif; 120 | } 121 | .section-heading { 122 | font-family: 'Vollkorn', serif; 123 | font-size: 45px; 124 | padding-bottom: 10px; 125 | } 126 | hr { 127 | border-color: #00468b; 128 | padding-bottom: 10px; 129 | } 130 | .description { 131 | margin-top: 20px; 132 | padding-bottom: 200px; 133 | } 134 | .description li { 135 | font-family: 'Vollkorn', serif; 136 | font-size: 25px; 137 | color: #525252; 138 | margin-left: 28%; 139 | padding-top: 5px; 140 | } 141 | .gap { 142 | margin-top: 200px; 143 | } 144 | .troubleshootingtext { 145 | color: rgba(255, 255, 255, 0.7); 146 | padding-left: 30%; 147 | } 148 | .troubleshootingtext li { 149 | list-style-type: circle; 150 | font-size: 25px; 151 | padding-bottom: 5px; 152 | } 153 | .overlay { 154 | position: absolute; 155 | top: 0; 156 | left: 0; 157 | width: 100%; 158 | height: 100%; 159 | z-index: 1000; 160 | } 161 | .block.response_body.json:hover { 162 | cursor: pointer; 163 | } 164 | .backdrop { 165 | color: blue; 166 | } 167 | #myModal { 168 | height: 100%; 169 | } 170 | .modal-backdrop { 171 | bottom: 0; 172 | position: fixed; 173 | } 174 | .curl { 175 | padding: 10px; 176 | font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; 177 | font-size: 0.9em; 178 | max-height: 400px; 179 | margin-top: 5px; 180 | overflow-y: auto; 181 | background-color: #fcf6db; 182 | border: 1px solid #e5e0c6; 183 | border-radius: 4px; 184 | } 185 | .curl_title { 186 | font-size: 1.1em; 187 | margin: 0; 188 | padding: 15px 0 5px; 189 | font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif; 190 | font-weight: 500; 191 | line-height: 1.1; 192 | } 193 | .footer { 194 | display: none; 195 | } 196 | .swagger-section .swagger-ui-wrap h2 { 197 | padding: 0; 198 | } 199 | h2 { 200 | margin: 0; 201 | margin-bottom: 5px; 202 | } 203 | .markdown p { 204 | font-size: 15px; 205 | font-family: 'Arvo', serif; 206 | } 207 | .swagger-section .swagger-ui-wrap .code { 208 | font-size: 15px; 209 | font-family: 'Arvo', serif; 210 | } 211 | .swagger-section .swagger-ui-wrap b { 212 | font-family: 'Arvo', serif; 213 | } 214 | #signin:hover { 215 | cursor: pointer; 216 | } 217 | .dropdown-menu { 218 | padding: 15px; 219 | } 220 | .navbar-right .dropdown-menu { 221 | left: 0; 222 | right: auto; 223 | } 224 | #signinbutton { 225 | width: 100%; 226 | height: 32px; 227 | font-size: 13px; 228 | font-weight: bold; 229 | color: #08b; 230 | } 231 | .navbar-default .nav > li .details { 232 | color: #000000; 233 | text-transform: none; 234 | font-size: 15px; 235 | font-weight: normal; 236 | font-family: 'Open Sans', sans-serif; 237 | font-style: italic; 238 | line-height: 20px; 239 | top: -2px; 240 | } 241 | .navbar-default .nav > li .details:hover { 242 | color: black; 243 | } 244 | #signout { 245 | width: 100%; 246 | height: 32px; 247 | font-size: 13px; 248 | font-weight: bold; 249 | color: #08b; 250 | } 251 | -------------------------------------------------------------------------------- /css/typography.css: -------------------------------------------------------------------------------- 1 | /* droid-sans-regular - latin */ 2 | @font-face { 3 | font-family: 'Droid Sans'; 4 | font-style: normal; 5 | font-weight: 400; 6 | src: url('../fonts/droid-sans-v6-latin-regular.eot'); /* IE9 Compat Modes */ 7 | src: local('Droid Sans'), local('DroidSans'), 8 | url('../fonts/droid-sans-v6-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ 9 | url('../fonts/droid-sans-v6-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ 10 | url('../fonts/droid-sans-v6-latin-regular.woff') format('woff'), /* Modern Browsers */ 11 | url('../fonts/droid-sans-v6-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */ 12 | url('../fonts/droid-sans-v6-latin-regular.svg#DroidSans') format('svg'); /* Legacy iOS */ 13 | } 14 | /* droid-sans-700 - latin */ 15 | @font-face { 16 | font-family: 'Droid Sans'; 17 | font-style: normal; 18 | font-weight: 700; 19 | src: url('../fonts/droid-sans-v6-latin-700.eot'); /* IE9 Compat Modes */ 20 | src: local('Droid Sans Bold'), local('DroidSans-Bold'), 21 | url('../fonts/droid-sans-v6-latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ 22 | url('../fonts/droid-sans-v6-latin-700.woff2') format('woff2'), /* Super Modern Browsers */ 23 | url('../fonts/droid-sans-v6-latin-700.woff') format('woff'), /* Modern Browsers */ 24 | url('../fonts/droid-sans-v6-latin-700.ttf') format('truetype'), /* Safari, Android, iOS */ 25 | url('../fonts/droid-sans-v6-latin-700.svg#DroidSans') format('svg'); /* Legacy iOS */ 26 | } 27 | -------------------------------------------------------------------------------- /demo.json: -------------------------------------------------------------------------------- 1 | { 2 | "swagger": "2.0", 3 | "info": { 4 | "description": "swagger-ui的汉化版本", 5 | "version": "1.0.0", 6 | "title": "汉化版Swagger-UI", 7 | "termsOfService": "http://swagger.io/terms/", 8 | "contact": { 9 | "email": "helei5200@126.com" 10 | }, 11 | "license": { 12 | "name": "Apache 2.0", 13 | "url": "http://www.apache.org/licenses/LICENSE-2.0.html" 14 | } 15 | }, 16 | "host": "petstore.swagger.io", 17 | "basePath": "/v2", 18 | "tags": [ 19 | { 20 | "name": "pet", 21 | "description": "有关你宠物的所有事情!", 22 | "externalDocs": { 23 | "description": "Find out more", 24 | "url": "http://swagger.io" 25 | } 26 | }, 27 | { 28 | "name": "store", 29 | "description": "访问宠物商店订单!" 30 | }, 31 | { 32 | "name": "user", 33 | "description": "操作用户相关!", 34 | "externalDocs": { 35 | "description": "Find out more about our store", 36 | "url": "http://swagger.io" 37 | } 38 | } 39 | ], 40 | "schemes": [ 41 | "http" 42 | ], 43 | "paths": { 44 | "/pet": { 45 | "post": { 46 | "tags": [ 47 | "pet" 48 | ], 49 | "summary": "添加一个新宠物到商店!", 50 | "description": "", 51 | "author": "helei 更新于 2015/06/17 19:56", 52 | "operationId": "addPet", 53 | "consumes": [ 54 | "application/json", 55 | "application/xml" 56 | ], 57 | "produces": [ 58 | "application/xml", 59 | "application/json" 60 | ], 61 | "parameters": [ 62 | { 63 | "in": "body", 64 | "name": "body", 65 | "description": "Pet object that needs to be added to the store", 66 | "required": true, 67 | "schema": { 68 | "$ref": "#/definitions/Pet" 69 | } 70 | } 71 | ], 72 | "responses": { 73 | "405": { 74 | "description": "Invalid input" 75 | } 76 | }, 77 | "security": [ 78 | { 79 | "petstore_auth": [ 80 | "write:pets", 81 | "read:pets" 82 | ] 83 | } 84 | ] 85 | }, 86 | "put": { 87 | "tags": [ 88 | "pet" 89 | ], 90 | "summary": "更新存在的宠物信息", 91 | "description": "", 92 | "author": "helei 更新于 2015/06/17 19:56", 93 | "operationId": "updatePet", 94 | "consumes": [ 95 | "application/json", 96 | "application/xml" 97 | ], 98 | "produces": [ 99 | "application/xml", 100 | "application/json" 101 | ], 102 | "parameters": [ 103 | { 104 | "in": "body", 105 | "name": "body", 106 | "description": "Pet object that needs to be added to the store", 107 | "required": true, 108 | "schema": { 109 | "$ref": "#/definitions/Pet" 110 | } 111 | } 112 | ], 113 | "responses": { 114 | "400": { 115 | "description": "Invalid ID supplied" 116 | }, 117 | "404": { 118 | "description": "Pet not found" 119 | }, 120 | "405": { 121 | "description": "Validation exception" 122 | } 123 | }, 124 | "security": [ 125 | { 126 | "petstore_auth": [ 127 | "write:pets", 128 | "read:pets" 129 | ] 130 | } 131 | ] 132 | } 133 | }, 134 | "/pet/findByStatus": { 135 | "get": { 136 | "tags": [ 137 | "pet" 138 | ], 139 | "summary": "根据状态查找宠物", 140 | "description": "Multiple status values can be provided with comma seperated strings", 141 | "author": "helei 更新于 2015/06/17 19:56", 142 | "operationId": "findPetsByStatus", 143 | "produces": [ 144 | "application/xml", 145 | "application/json" 146 | ], 147 | "parameters": [ 148 | { 149 | "name": "status", 150 | "in": "query", 151 | "description": "Status values that need to be considered for filter", 152 | "required": true, 153 | "type": "array", 154 | "items": { 155 | "type": "string", 156 | "enum": [ 157 | "available", 158 | "pending", 159 | "sold" 160 | ], 161 | "default": "available" 162 | }, 163 | "collectionFormat": "csv" 164 | } 165 | ], 166 | "responses": { 167 | "200": { 168 | "description": "successful operation", 169 | "schema": { 170 | "type": "array", 171 | "items": { 172 | "$ref": "#/definitions/Pet" 173 | } 174 | } 175 | }, 176 | "400": { 177 | "description": "Invalid status value" 178 | } 179 | }, 180 | "security": [ 181 | { 182 | "petstore_auth": [ 183 | "write:pets", 184 | "read:pets" 185 | ] 186 | } 187 | ] 188 | } 189 | }, 190 | "/pet/findByTags": { 191 | "get": { 192 | "tags": [ 193 | "pet" 194 | ], 195 | "summary": "根据tags查找宠物", 196 | "description": "Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.", 197 | "author": "helei 更新于 2015/06/17 19:56", 198 | "operationId": "findPetsByTags", 199 | "produces": [ 200 | "application/xml", 201 | "application/json" 202 | ], 203 | "parameters": [ 204 | { 205 | "name": "tags", 206 | "in": "query", 207 | "description": "Tags to filter by", 208 | "required": true, 209 | "type": "array", 210 | "items": { 211 | "type": "string" 212 | }, 213 | "collectionFormat": "csv" 214 | } 215 | ], 216 | "responses": { 217 | "200": { 218 | "description": "successful operation", 219 | "schema": { 220 | "type": "array", 221 | "items": { 222 | "$ref": "#/definitions/Pet" 223 | } 224 | } 225 | }, 226 | "400": { 227 | "description": "Invalid tag value" 228 | } 229 | }, 230 | "security": [ 231 | { 232 | "petstore_auth": [ 233 | "write:pets", 234 | "read:pets" 235 | ] 236 | } 237 | ] 238 | } 239 | }, 240 | "/pet/{petId}": { 241 | "get": { 242 | "tags": [ 243 | "pet" 244 | ], 245 | "summary": "根据id查找宠物", 246 | "description": "Returns a single pet", 247 | "author": "helei 更新于 2015/06/17 19:56", 248 | "operationId": "getPetById", 249 | "produces": [ 250 | "application/xml", 251 | "application/json" 252 | ], 253 | "parameters": [ 254 | { 255 | "name": "petId", 256 | "in": "path", 257 | "description": "ID of pet to return", 258 | "required": true, 259 | "type": "integer", 260 | "format": "int64" 261 | } 262 | ], 263 | "responses": { 264 | "200": { 265 | "description": "successful operation", 266 | "schema": { 267 | "$ref": "#/definitions/Pet" 268 | } 269 | }, 270 | "400": { 271 | "description": "Invalid ID supplied" 272 | }, 273 | "404": { 274 | "description": "Pet not found" 275 | } 276 | }, 277 | "security": [ 278 | { 279 | "api_key": [] 280 | } 281 | ] 282 | }, 283 | "post": { 284 | "tags": [ 285 | "pet" 286 | ], 287 | "summary": "根据表单数据,更新宠物数据", 288 | "description": "", 289 | "author": "helei 更新于 2015/06/17 19:56", 290 | "operationId": "updatePetWithForm", 291 | "consumes": [ 292 | "application/x-www-form-urlencoded" 293 | ], 294 | "produces": [ 295 | "application/xml", 296 | "application/json" 297 | ], 298 | "parameters": [ 299 | { 300 | "name": "petId", 301 | "in": "path", 302 | "description": "ID of pet that needs to be updated", 303 | "required": true, 304 | "type": "integer", 305 | "format": "int64" 306 | }, 307 | { 308 | "name": "name", 309 | "in": "formData", 310 | "description": "Updated name of the pet", 311 | "required": false, 312 | "type": "string" 313 | }, 314 | { 315 | "name": "status", 316 | "in": "formData", 317 | "description": "Updated status of the pet", 318 | "required": false, 319 | "type": "string" 320 | } 321 | ], 322 | "responses": { 323 | "405": { 324 | "description": "Invalid input" 325 | } 326 | }, 327 | "security": [ 328 | { 329 | "petstore_auth": [ 330 | "write:pets", 331 | "read:pets" 332 | ] 333 | } 334 | ] 335 | }, 336 | "delete": { 337 | "tags": [ 338 | "pet" 339 | ], 340 | "summary": "删除宠物", 341 | "description": "", 342 | "author": "helei 更新于 2015/06/17 19:56", 343 | "operationId": "deletePet", 344 | "produces": [ 345 | "application/xml", 346 | "application/json" 347 | ], 348 | "parameters": [ 349 | { 350 | "name": "api_key", 351 | "in": "header", 352 | "required": false, 353 | "type": "string" 354 | }, 355 | { 356 | "name": "petId", 357 | "in": "path", 358 | "description": "Pet id to delete", 359 | "required": true, 360 | "type": "integer", 361 | "format": "int64" 362 | } 363 | ], 364 | "responses": { 365 | "400": { 366 | "description": "Invalid pet value" 367 | } 368 | }, 369 | "security": [ 370 | { 371 | "petstore_auth": [ 372 | "write:pets", 373 | "read:pets" 374 | ] 375 | } 376 | ] 377 | } 378 | }, 379 | "/pet/{petId}/uploadImage": { 380 | "post": { 381 | "tags": [ 382 | "pet" 383 | ], 384 | "summary": "更新图片", 385 | "description": "", 386 | "author": "helei 更新于 2015/06/17 19:56", 387 | "operationId": "uploadFile", 388 | "consumes": [ 389 | "multipart/form-data" 390 | ], 391 | "produces": [ 392 | "application/json" 393 | ], 394 | "parameters": [ 395 | { 396 | "name": "petId", 397 | "in": "path", 398 | "description": "ID of pet to update", 399 | "required": true, 400 | "type": "integer", 401 | "format": "int64" 402 | }, 403 | { 404 | "name": "additionalMetadata", 405 | "in": "formData", 406 | "description": "Additional data to pass to server", 407 | "required": false, 408 | "type": "string" 409 | }, 410 | { 411 | "name": "file", 412 | "in": "formData", 413 | "description": "file to upload", 414 | "required": false, 415 | "type": "file" 416 | } 417 | ], 418 | "responses": { 419 | "200": { 420 | "description": "successful operation", 421 | "schema": { 422 | "$ref": "#/definitions/ApiResponse" 423 | } 424 | } 425 | }, 426 | "security": [ 427 | { 428 | "petstore_auth": [ 429 | "write:pets", 430 | "read:pets" 431 | ] 432 | } 433 | ] 434 | } 435 | }, 436 | "/store/inventory": { 437 | "get": { 438 | "tags": [ 439 | "store" 440 | ], 441 | "summary": "返回宠物库存状态", 442 | "description": "Returns a map of status codes to quantities", 443 | "author": "helei 更新于 2015/06/17 19:56", 444 | "operationId": "getInventory", 445 | "produces": [ 446 | "application/json" 447 | ], 448 | "parameters": [], 449 | "responses": { 450 | "200": { 451 | "description": "successful operation", 452 | "schema": { 453 | "type": "object", 454 | "additionalProperties": { 455 | "type": "integer", 456 | "format": "int32" 457 | } 458 | } 459 | } 460 | }, 461 | "security": [ 462 | { 463 | "api_key": [] 464 | } 465 | ] 466 | } 467 | }, 468 | "/store/order": { 469 | "post": { 470 | "tags": [ 471 | "store" 472 | ], 473 | "summary": "订购一个宠物", 474 | "description": "", 475 | "author": "helei 更新于 2015/06/17 19:56", 476 | "operationId": "placeOrder", 477 | "produces": [ 478 | "application/xml", 479 | "application/json" 480 | ], 481 | "parameters": [ 482 | { 483 | "in": "body", 484 | "name": "body", 485 | "description": "order placed for purchasing the pet", 486 | "required": true, 487 | "schema": { 488 | "$ref": "#/definitions/Order" 489 | } 490 | } 491 | ], 492 | "responses": { 493 | "200": { 494 | "description": "successful operation", 495 | "schema": { 496 | "$ref": "#/definitions/Order" 497 | } 498 | }, 499 | "400": { 500 | "description": "Invalid Order" 501 | } 502 | } 503 | } 504 | }, 505 | "/store/order/{orderId}": { 506 | "get": { 507 | "tags": [ 508 | "store" 509 | ], 510 | "summary": "根据ID查找订单", 511 | "description": "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", 512 | "author": "helei 更新于 2015/06/17 19:56", 513 | "operationId": "getOrderById", 514 | "produces": [ 515 | "application/xml", 516 | "application/json" 517 | ], 518 | "parameters": [ 519 | { 520 | "name": "orderId", 521 | "in": "path", 522 | "description": "ID of pet that needs to be fetched", 523 | "required": true, 524 | "type": "integer", 525 | "maximum": 5, 526 | "minimum": 1, 527 | "format": "int64" 528 | } 529 | ], 530 | "responses": { 531 | "200": { 532 | "description": "successful operation", 533 | "schema": { 534 | "$ref": "#/definitions/Order" 535 | } 536 | }, 537 | "400": { 538 | "description": "Invalid ID supplied" 539 | }, 540 | "404": { 541 | "description": "Order not found" 542 | } 543 | } 544 | }, 545 | "delete": { 546 | "tags": [ 547 | "store" 548 | ], 549 | "summary": "根据ID删除订单", 550 | "description": "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", 551 | "author": "helei 更新于 2015/06/17 19:56", 552 | "operationId": "deleteOrder", 553 | "produces": [ 554 | "application/xml", 555 | "application/json" 556 | ], 557 | "parameters": [ 558 | { 559 | "name": "orderId", 560 | "in": "path", 561 | "description": "ID of the order that needs to be deleted", 562 | "required": true, 563 | "type": "string", 564 | "minimum": 1 565 | } 566 | ], 567 | "responses": { 568 | "400": { 569 | "description": "Invalid ID supplied" 570 | }, 571 | "404": { 572 | "description": "Order not found" 573 | } 574 | } 575 | } 576 | }, 577 | "/user": { 578 | "post": { 579 | "tags": [ 580 | "user" 581 | ], 582 | "summary": "创建用户", 583 | "description": "This can only be done by the logged in user.", 584 | "author": "helei 更新于 2015/06/17 19:56", 585 | "operationId": "createUser", 586 | "produces": [ 587 | "application/xml", 588 | "application/json" 589 | ], 590 | "parameters": [ 591 | { 592 | "in": "body", 593 | "name": "body", 594 | "description": "Created user object", 595 | "required": true, 596 | "schema": { 597 | "$ref": "#/definitions/User" 598 | } 599 | } 600 | ], 601 | "responses": { 602 | "default": { 603 | "description": "successful operation" 604 | } 605 | } 606 | } 607 | }, 608 | "/user/createWithArray": { 609 | "post": { 610 | "tags": [ 611 | "user" 612 | ], 613 | "summary": "根据传入数组,创建多个用户", 614 | "description": "", 615 | "author": "helei 更新于 2015/06/17 19:56", 616 | "operationId": "createUsersWithArrayInput", 617 | "produces": [ 618 | "application/xml", 619 | "application/json" 620 | ], 621 | "parameters": [ 622 | { 623 | "in": "body", 624 | "name": "body", 625 | "description": "List of user object", 626 | "required": true, 627 | "schema": { 628 | "type": "array", 629 | "items": { 630 | "$ref": "#/definitions/User" 631 | } 632 | } 633 | } 634 | ], 635 | "responses": { 636 | "default": { 637 | "description": "successful operation" 638 | } 639 | } 640 | } 641 | }, 642 | "/user/createWithList": { 643 | "post": { 644 | "tags": [ 645 | "user" 646 | ], 647 | "summary": "根据列表创建多个用户", 648 | "description": "", 649 | "author": "helei 更新于 2015/06/17 19:56", 650 | "operationId": "createUsersWithListInput", 651 | "produces": [ 652 | "application/xml", 653 | "application/json" 654 | ], 655 | "parameters": [ 656 | { 657 | "in": "body", 658 | "name": "body", 659 | "description": "List of user object", 660 | "required": true, 661 | "schema": { 662 | "type": "array", 663 | "items": { 664 | "$ref": "#/definitions/User" 665 | } 666 | } 667 | } 668 | ], 669 | "responses": { 670 | "default": { 671 | "description": "successful operation" 672 | } 673 | } 674 | } 675 | }, 676 | "/user/login": { 677 | "get": { 678 | "tags": [ 679 | "user" 680 | ], 681 | "summary": "用户登录系统", 682 | "description": "", 683 | "author": "helei 更新于 2015/06/17 19:56", 684 | "operationId": "loginUser", 685 | "produces": [ 686 | "application/xml", 687 | "application/json" 688 | ], 689 | "parameters": [ 690 | { 691 | "name": "username", 692 | "in": "query", 693 | "description": "The user name for login", 694 | "required": true, 695 | "type": "string" 696 | }, 697 | { 698 | "name": "password", 699 | "in": "query", 700 | "description": "The password for login in clear text", 701 | "required": true, 702 | "type": "string" 703 | } 704 | ], 705 | "responses": { 706 | "200": { 707 | "description": "successful operation", 708 | "schema": { 709 | "type": "string" 710 | }, 711 | "headers": { 712 | "X-Rate-Limit": { 713 | "type": "integer", 714 | "format": "int32", 715 | "description": "calls per hour allowed by the user" 716 | }, 717 | "X-Expires-After": { 718 | "type": "string", 719 | "format": "date-time", 720 | "description": "date in UTC when toekn expires" 721 | } 722 | } 723 | }, 724 | "400": { 725 | "description": "Invalid username/password supplied" 726 | } 727 | } 728 | } 729 | }, 730 | "/user/logout": { 731 | "get": { 732 | "tags": [ 733 | "user" 734 | ], 735 | "summary": "用户退出登录,并清除session", 736 | "description": "", 737 | "author": "helei 更新于 2015/06/17 19:56", 738 | "operationId": "logoutUser", 739 | "produces": [ 740 | "application/xml", 741 | "application/json" 742 | ], 743 | "parameters": [], 744 | "responses": { 745 | "default": { 746 | "description": "successful operation" 747 | } 748 | } 749 | } 750 | }, 751 | "/user/{username}": { 752 | "get": { 753 | "tags": [ 754 | "user" 755 | ], 756 | "summary": "根据用户名获取用户", 757 | "description": "", 758 | "author": "helei 更新于 2015/06/17 19:56", 759 | "operationId": "getUserByName", 760 | "produces": [ 761 | "application/xml", 762 | "application/json" 763 | ], 764 | "parameters": [ 765 | { 766 | "name": "username", 767 | "in": "path", 768 | "description": "The name that needs to be fetched. Use user1 for testing. ", 769 | "required": true, 770 | "type": "string" 771 | } 772 | ], 773 | "responses": { 774 | "200": { 775 | "description": "successful operation", 776 | "schema": { 777 | "$ref": "#/definitions/User" 778 | } 779 | }, 780 | "400": { 781 | "description": "Invalid username supplied" 782 | }, 783 | "404": { 784 | "description": "User not found" 785 | } 786 | } 787 | }, 788 | "put": { 789 | "tags": [ 790 | "user" 791 | ], 792 | "summary": "更新用户", 793 | "author": "helei 更新于 2015/06/17 19:56", 794 | "description": "This can only be done by the logged in user.", 795 | "operationId": "updateUser", 796 | "produces": [ 797 | "application/xml", 798 | "application/json" 799 | ], 800 | "parameters": [ 801 | { 802 | "name": "username", 803 | "in": "path", 804 | "description": "name that need to be deleted", 805 | "required": true, 806 | "type": "string" 807 | }, 808 | { 809 | "in": "body", 810 | "name": "body", 811 | "description": "Updated user object", 812 | "required": true, 813 | "schema": { 814 | "$ref": "#/definitions/User" 815 | } 816 | } 817 | ], 818 | "responses": { 819 | "400": { 820 | "description": "Invalid user supplied" 821 | }, 822 | "404": { 823 | "description": "User not found" 824 | } 825 | } 826 | }, 827 | "delete": { 828 | "tags": [ 829 | "user" 830 | ], 831 | "summary": "删除用户", 832 | "author": "helei 更新于 2015/06/17 19:56", 833 | "description": "This can only be done by the logged in user.", 834 | "operationId": "deleteUser", 835 | "produces": [ 836 | "application/xml", 837 | "application/json" 838 | ], 839 | "parameters": [ 840 | { 841 | "name": "username", 842 | "in": "path", 843 | "description": "The name that needs to be deleted", 844 | "required": true, 845 | "type": "string" 846 | } 847 | ], 848 | "responses": { 849 | "400": { 850 | "description": "Invalid username supplied" 851 | }, 852 | "404": { 853 | "description": "User not found" 854 | } 855 | } 856 | } 857 | } 858 | }, 859 | "securityDefinitions": { 860 | "petstore_auth": { 861 | "type": "oauth2", 862 | "authorizationUrl": "http://petstore.swagger.io/api/oauth/dialog", 863 | "flow": "implicit", 864 | "scopes": { 865 | "write:pets": "modify pets in your account", 866 | "read:pets": "read your pets" 867 | } 868 | }, 869 | "api_key": { 870 | "type": "apiKey", 871 | "name": "api_key", 872 | "in": "header" 873 | } 874 | }, 875 | "definitions": { 876 | "Order": { 877 | "type": "object", 878 | "properties": { 879 | "id": { 880 | "type": "integer", 881 | "format": "int64" 882 | }, 883 | "petId": { 884 | "type": "integer", 885 | "format": "int64" 886 | }, 887 | "quantity": { 888 | "type": "integer", 889 | "format": "int32" 890 | }, 891 | "shipDate": { 892 | "type": "string", 893 | "format": "date-time" 894 | }, 895 | "status": { 896 | "type": "string", 897 | "description": "Order Status", 898 | "enum": [ 899 | "placed", 900 | "approved", 901 | "delivered" 902 | ] 903 | }, 904 | "complete": { 905 | "type": "boolean", 906 | "default": false 907 | } 908 | }, 909 | "xml": { 910 | "name": "Order" 911 | } 912 | }, 913 | "Category": { 914 | "type": "object", 915 | "properties": { 916 | "id": { 917 | "type": "integer", 918 | "format": "int64" 919 | }, 920 | "name": { 921 | "type": "string" 922 | } 923 | }, 924 | "xml": { 925 | "name": "Category" 926 | } 927 | }, 928 | "User": { 929 | "type": "object", 930 | "properties": { 931 | "id": { 932 | "type": "integer", 933 | "format": "int64" 934 | }, 935 | "username": { 936 | "type": "string" 937 | }, 938 | "firstName": { 939 | "type": "string" 940 | }, 941 | "lastName": { 942 | "type": "string" 943 | }, 944 | "email": { 945 | "type": "string" 946 | }, 947 | "password": { 948 | "type": "string" 949 | }, 950 | "phone": { 951 | "type": "string" 952 | }, 953 | "userStatus": { 954 | "type": "integer", 955 | "format": "int32", 956 | "description": "User Status" 957 | } 958 | }, 959 | "xml": { 960 | "name": "User" 961 | } 962 | }, 963 | "Tag": { 964 | "type": "object", 965 | "properties": { 966 | "id": { 967 | "type": "integer", 968 | "format": "int64" 969 | }, 970 | "name": { 971 | "type": "string" 972 | } 973 | }, 974 | "xml": { 975 | "name": "Tag" 976 | } 977 | }, 978 | "Pet": { 979 | "type": "object", 980 | "required": [ 981 | "name", 982 | "photoUrls" 983 | ], 984 | "properties": { 985 | "id": { 986 | "type": "integer", 987 | "format": "int64" 988 | }, 989 | "category": { 990 | "$ref": "#/definitions/Category" 991 | }, 992 | "name": { 993 | "type": "string", 994 | "example": "doggie" 995 | }, 996 | "photoUrls": { 997 | "type": "array", 998 | "xml": { 999 | "name": "photoUrl", 1000 | "wrapped": true 1001 | }, 1002 | "items": { 1003 | "type": "string" 1004 | } 1005 | }, 1006 | "tags": { 1007 | "type": "array", 1008 | "xml": { 1009 | "name": "tag", 1010 | "wrapped": true 1011 | }, 1012 | "items": { 1013 | "$ref": "#/definitions/Tag" 1014 | } 1015 | }, 1016 | "status": { 1017 | "type": "string", 1018 | "description": "pet status in the store", 1019 | "enum": [ 1020 | "available", 1021 | "pending", 1022 | "sold" 1023 | ] 1024 | } 1025 | }, 1026 | "xml": { 1027 | "name": "Pet" 1028 | } 1029 | }, 1030 | "ApiResponse": { 1031 | "type": "object", 1032 | "properties": { 1033 | "code": { 1034 | "type": "integer", 1035 | "format": "int32" 1036 | }, 1037 | "type": { 1038 | "type": "string" 1039 | }, 1040 | "message": { 1041 | "type": "string" 1042 | } 1043 | } 1044 | } 1045 | }, 1046 | "externalDocs": { 1047 | "description": "了解一下我们吧!", 1048 | "url": "https://github.com/helei112g" 1049 | } 1050 | } -------------------------------------------------------------------------------- /fonts/droid-sans-v6-latin-700.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/swagger-ui/49bd309660d8f9e89416d646b6d4429b0c5305f3/fonts/droid-sans-v6-latin-700.eot -------------------------------------------------------------------------------- /fonts/droid-sans-v6-latin-700.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/swagger-ui/49bd309660d8f9e89416d646b6d4429b0c5305f3/fonts/droid-sans-v6-latin-700.ttf -------------------------------------------------------------------------------- /fonts/droid-sans-v6-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/swagger-ui/49bd309660d8f9e89416d646b6d4429b0c5305f3/fonts/droid-sans-v6-latin-700.woff -------------------------------------------------------------------------------- /fonts/droid-sans-v6-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/swagger-ui/49bd309660d8f9e89416d646b6d4429b0c5305f3/fonts/droid-sans-v6-latin-700.woff2 -------------------------------------------------------------------------------- /fonts/droid-sans-v6-latin-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/swagger-ui/49bd309660d8f9e89416d646b6d4429b0c5305f3/fonts/droid-sans-v6-latin-regular.eot -------------------------------------------------------------------------------- /fonts/droid-sans-v6-latin-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/swagger-ui/49bd309660d8f9e89416d646b6d4429b0c5305f3/fonts/droid-sans-v6-latin-regular.ttf -------------------------------------------------------------------------------- /fonts/droid-sans-v6-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/swagger-ui/49bd309660d8f9e89416d646b6d4429b0c5305f3/fonts/droid-sans-v6-latin-regular.woff -------------------------------------------------------------------------------- /fonts/droid-sans-v6-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/swagger-ui/49bd309660d8f9e89416d646b6d4429b0c5305f3/fonts/droid-sans-v6-latin-regular.woff2 -------------------------------------------------------------------------------- /images/explorer_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/swagger-ui/49bd309660d8f9e89416d646b6d4429b0c5305f3/images/explorer_icons.png -------------------------------------------------------------------------------- /images/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/swagger-ui/49bd309660d8f9e89416d646b6d4429b0c5305f3/images/favicon-16x16.png -------------------------------------------------------------------------------- /images/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/swagger-ui/49bd309660d8f9e89416d646b6d4429b0c5305f3/images/favicon-32x32.png -------------------------------------------------------------------------------- /images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/swagger-ui/49bd309660d8f9e89416d646b6d4429b0c5305f3/images/favicon.ico -------------------------------------------------------------------------------- /images/logo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/swagger-ui/49bd309660d8f9e89416d646b6d4429b0c5305f3/images/logo_small.png -------------------------------------------------------------------------------- /images/pet_store_api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/swagger-ui/49bd309660d8f9e89416d646b6d4429b0c5305f3/images/pet_store_api.png -------------------------------------------------------------------------------- /images/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/swagger-ui/49bd309660d8f9e89416d646b6d4429b0c5305f3/images/throbber.gif -------------------------------------------------------------------------------- /images/wordnik_api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/swagger-ui/49bd309660d8f9e89416d646b6d4429b0c5305f3/images/wordnik_api.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |