├── .gitattributes ├── .gitignore ├── .travis.yml ├── README.md ├── composer.json ├── config ├── .gitkeep ├── local │ └── swaggervel.php └── swagger.php ├── phpunit.xml ├── public ├── css │ ├── print.css │ ├── reset.css │ ├── screen.css │ ├── style.css │ └── typography.css ├── 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 ├── 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 ├── resources └── views │ ├── .gitkeep │ └── index.blade.php ├── src ├── SwaggervelServiceProvider.php └── routes.php └── tests └── .gitkeep /.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 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear on external disk 35 | .Spotlight-V100 36 | .Trashes 37 | 38 | # Directories potentially created on remote AFP share 39 | .AppleDB 40 | .AppleDesktop 41 | Network Trash Folder 42 | Temporary Items 43 | .apdisk 44 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 5.3 5 | - 5.4 6 | - 5.5 7 | - 5.6 8 | - hhvm 9 | 10 | before_script: 11 | - composer self-update 12 | - composer install --prefer-source --no-interaction --dev 13 | 14 | script: phpunit 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 说明 2 | 该项目,主要用于解决API文档生成的问题。 3 | 项目基于laravel5+swagger-php构成。[项目源地址](https://github.com/slampenny/Swaggervel) 4 | 5 | # 改进日志 6 | * V1.1.1 修改了依赖swagger-php包版本问题(swagger-php v2上的版本使用了PSR-4标准) 7 | * 2015年7月1日 [v1.1.0] 修改路由 8 | * 修改了项目文件结构 9 | * 将swagger前端部分版本提升到V2.1版本,使用swagger前端[项目地址](https://github.com/helei112g/swagger-ui) 10 | * 将项目改进为PSR-4自动加载,抛弃之前的PSR-0 11 | 12 | # 安装 13 | 建议采用 `composer` 进行安装, 14 | 1. 在项目的composer.json中配置 `"riverslei/laravel-swagger": "~1.0"` 15 | 2. 运行 `composer update` 16 | 3. 安装完成后,配置 `config/app.php` 中的服务提供者 `Riverslei\Swaggervel\SwaggervelServiceProvider::class` 17 | 4. 以上配置完成后,运行 `php artisan vendor:publish` ,生成相关的配置文件以及资源文件。 18 | 19 | *通过以上配置,已经完成了所有的安装工作,现在开始运行* 20 | 21 | # 运行 22 | 查看api-doc的路由,使用一下命令 23 | ```artisan 24 | php artisan route:list 25 | ``` 26 | 根据路由信息,访问:baseUrl+api-docs,如果看到swagger的首页,说明已经成功 27 | 28 | # 补充 29 | 安装该lib后,不需要再运行命令生成相关的json文件,一切在你运行url访问你项目swagger文档首页时,它会自动扫描相关的Model及Controller 30 | ,一切就是这么美妙,以后再也不需要劳心费神的写api接口文档了。 31 | 32 | 这里给出swagger-php注解的书写规则文档:[官方文档](http://zircote.com/swagger-php/annotations.html) 33 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "riverslei/laravel-swagger", 3 | "description": "在laravel5中使用swagger自动生成api接口文档", 4 | "keywords": ["laravel", "swagger", "laravel swagger", "laravel5", "swagger-php", "documentation", "api"], 5 | "license": "MIT", 6 | "authors": [ 7 | { 8 | "name": "helei112g", 9 | "email": "helei5200@126.com" 10 | } 11 | ], 12 | "require": { 13 | "php": ">=5.5.9", 14 | "zircote/swagger-php": "~1.0" 15 | }, 16 | "autoload": { 17 | "psr-4": { 18 | "Riverslei\\Swaggervel\\": "src/" 19 | } 20 | }, 21 | "minimum-stability": "stable" 22 | } 23 | -------------------------------------------------------------------------------- /config/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/laravel-swagger/c2cca64e92315a99d2735bbf925c4e3be9527f4d/config/.gitkeep -------------------------------------------------------------------------------- /config/local/swaggervel.php: -------------------------------------------------------------------------------- 1 | storage_path() . '/docs', 16 | 17 | /* 18 | |-------------------------------------------------------------------------- 19 | | Relative path to access parsed swagger annotations. 20 | |-------------------------------------------------------------------------- 21 | */ 22 | 'doc-route' => 'docs', 23 | 24 | /* 25 | |-------------------------------------------------------------------------- 26 | | Absolute path to directory containing the swagger annotations are stored. 27 | |-------------------------------------------------------------------------- 28 | */ 29 | "app-dir" => "app", 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Absolute path to directories that you would like to exclude from swagger generation 34 | |-------------------------------------------------------------------------- 35 | */ 36 | "excludes" => array( 37 | storage_path(), 38 | base_path()."/tests", 39 | base_path()."/resources/views", 40 | base_path()."/config" 41 | ), 42 | 43 | /* 44 | |-------------------------------------------------------------------------- 45 | | Turn this off to remove swagger generation on production 46 | |-------------------------------------------------------------------------- 47 | */ 48 | "generateAlways" => true, 49 | 50 | "api-key" => "auth_token", 51 | 52 | /* 53 | |-------------------------------------------------------------------------- 54 | | Edit to set the api's version number 55 | |-------------------------------------------------------------------------- 56 | */ 57 | "default-api-version" => "", 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | Edit to set the swagger version number 62 | |-------------------------------------------------------------------------- 63 | */ 64 | "default-swagger-version" => "1.2", 65 | 66 | /* 67 | |-------------------------------------------------------------------------- 68 | | Edit to set the api's base path 69 | |-------------------------------------------------------------------------- 70 | */ 71 | "default-base-path" => "", 72 | 73 | /* 74 | |-------------------------------------------------------------------------- 75 | | Edit to trust the proxy's ip address - needed for AWS Load Balancer 76 | |-------------------------------------------------------------------------- 77 | */ 78 | "behind-reverse-proxy" => false, 79 | /* 80 | |-------------------------------------------------------------------------- 81 | | Uncomment to add response headers when swagger is generated 82 | |-------------------------------------------------------------------------- 83 | */ 84 | /*"viewHeaders" => array( 85 | 'Content-Type' => 'text/plain' 86 | ),*/ 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Uncomment to add request headers when swagger performs requests 91 | |-------------------------------------------------------------------------- 92 | */ 93 | /*"requestHeaders" => array( 94 | 'TestMe' => 'testValue' 95 | ),*/ 96 | ); 97 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | ./tests/ 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /public/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 | -------------------------------------------------------------------------------- /public/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 | -------------------------------------------------------------------------------- /public/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 | -------------------------------------------------------------------------------- /public/fonts/droid-sans-v6-latin-700.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/laravel-swagger/c2cca64e92315a99d2735bbf925c4e3be9527f4d/public/fonts/droid-sans-v6-latin-700.eot -------------------------------------------------------------------------------- /public/fonts/droid-sans-v6-latin-700.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/laravel-swagger/c2cca64e92315a99d2735bbf925c4e3be9527f4d/public/fonts/droid-sans-v6-latin-700.ttf -------------------------------------------------------------------------------- /public/fonts/droid-sans-v6-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/laravel-swagger/c2cca64e92315a99d2735bbf925c4e3be9527f4d/public/fonts/droid-sans-v6-latin-700.woff -------------------------------------------------------------------------------- /public/fonts/droid-sans-v6-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/laravel-swagger/c2cca64e92315a99d2735bbf925c4e3be9527f4d/public/fonts/droid-sans-v6-latin-700.woff2 -------------------------------------------------------------------------------- /public/fonts/droid-sans-v6-latin-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/laravel-swagger/c2cca64e92315a99d2735bbf925c4e3be9527f4d/public/fonts/droid-sans-v6-latin-regular.eot -------------------------------------------------------------------------------- /public/fonts/droid-sans-v6-latin-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/laravel-swagger/c2cca64e92315a99d2735bbf925c4e3be9527f4d/public/fonts/droid-sans-v6-latin-regular.ttf -------------------------------------------------------------------------------- /public/fonts/droid-sans-v6-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/laravel-swagger/c2cca64e92315a99d2735bbf925c4e3be9527f4d/public/fonts/droid-sans-v6-latin-regular.woff -------------------------------------------------------------------------------- /public/fonts/droid-sans-v6-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/laravel-swagger/c2cca64e92315a99d2735bbf925c4e3be9527f4d/public/fonts/droid-sans-v6-latin-regular.woff2 -------------------------------------------------------------------------------- /public/images/explorer_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/laravel-swagger/c2cca64e92315a99d2735bbf925c4e3be9527f4d/public/images/explorer_icons.png -------------------------------------------------------------------------------- /public/images/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/laravel-swagger/c2cca64e92315a99d2735bbf925c4e3be9527f4d/public/images/favicon-16x16.png -------------------------------------------------------------------------------- /public/images/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/laravel-swagger/c2cca64e92315a99d2735bbf925c4e3be9527f4d/public/images/favicon-32x32.png -------------------------------------------------------------------------------- /public/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/laravel-swagger/c2cca64e92315a99d2735bbf925c4e3be9527f4d/public/images/favicon.ico -------------------------------------------------------------------------------- /public/images/logo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/laravel-swagger/c2cca64e92315a99d2735bbf925c4e3be9527f4d/public/images/logo_small.png -------------------------------------------------------------------------------- /public/images/pet_store_api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/laravel-swagger/c2cca64e92315a99d2735bbf925c4e3be9527f4d/public/images/pet_store_api.png -------------------------------------------------------------------------------- /public/images/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/laravel-swagger/c2cca64e92315a99d2735bbf925c4e3be9527f4d/public/images/throbber.gif -------------------------------------------------------------------------------- /public/images/wordnik_api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helei112g/laravel-swagger/c2cca64e92315a99d2735bbf925c4e3be9527f4d/public/images/wordnik_api.png -------------------------------------------------------------------------------- /public/lang/en.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* jshint quotmark: double */ 4 | window.SwaggerTranslator.learn({ 5 | "Warning: Deprecated":"Warning: Deprecated", 6 | "Implementation Notes":"Implementation Notes", 7 | "Response Class":"Response Class", 8 | "Status":"Status", 9 | "Parameters":"Parameters", 10 | "Parameter":"Parameter", 11 | "Value":"Value", 12 | "Description":"Description", 13 | "Parameter Type":"Parameter Type", 14 | "Data Type":"Data Type", 15 | "Response Messages":"Response Messages", 16 | "HTTP Status Code":"HTTP Status Code", 17 | "Reason":"Reason", 18 | "Response Model":"Response Model", 19 | "Request URL":"Request URL", 20 | "Response Body":"Response Body", 21 | "Response Code":"Response Code", 22 | "Response Headers":"Response Headers", 23 | "Hide Response":"Hide Response", 24 | "Try it out!":"Try it out!", 25 | "Show/Hide":"Show/Hide", 26 | "List Operations":"List Operations", 27 | "Expand Operations":"Expand Operations", 28 | "Raw":"Raw", 29 | "can't parse JSON. Raw result":"can't parse JSON. Raw result", 30 | "Model Schema":"Model Schema", 31 | "Model":"Model", 32 | "apply":"apply", 33 | "Username":"Username", 34 | "Password":"Password", 35 | "Terms of service":"Terms of service", 36 | "Created by":"Created by", 37 | "See more at":"See more at", 38 | "Contact the developer":"Contact the developer", 39 | "api version":"api version", 40 | "Response Content Type":"Response Content Type", 41 | "fetching resource":"fetching resource", 42 | "fetching resource list":"fetching resource list", 43 | "Explore":"Explore", 44 | "Show Swagger Petstore Example Apis":"Show Swagger Petstore Example Apis", 45 | "Can't read from server. It may not have the appropriate access-control-origin settings.":"Can't read from server. It may not have the appropriate access-control-origin settings.", 46 | "Please specify the protocol for":"Please specify the protocol for", 47 | "Can't read swagger JSON from":"Can't read swagger JSON from", 48 | "Finished Loading Resource Information. Rendering Swagger UI":"Finished Loading Resource Information. Rendering Swagger UI", 49 | "Unable to read api":"Unable to read api", 50 | "from path":"from path", 51 | "server returned":"server returned" 52 | }); 53 | -------------------------------------------------------------------------------- /public/lang/translator.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Translator for documentation pages. 5 | * 6 | * To enable translation you should include one of language-files in your index.html 7 | * after . 8 | * For example - 9 | * 10 | * If you wish to translate some new texsts you should do two things: 11 | * 1. Add a new phrase pair ("New Phrase": "New Translation") into your language file (for example lang/ru.js). It will be great if you add it in other language files too. 12 | * 2. Mark that text it templates this way New Phrase or . 13 | * The main thing here is attribute data-sw-translate. Only inner html, title-attribute and value-attribute are going to translate. 14 | * 15 | */ 16 | window.SwaggerTranslator = { 17 | _words:[], 18 | 19 | translate: function() { 20 | var $this = this; 21 | $('[data-sw-translate]').each(function(){ 22 | $(this).html($this._tryTranslate($(this).html())); 23 | $(this).val($this._tryTranslate($(this).val())); 24 | $(this).attr('title', $this._tryTranslate($(this).attr('title'))); 25 | }); 26 | }, 27 | 28 | _tryTranslate: function(word){ 29 | return this._words[$.trim(word)] !== undefined ? this._words[$.trim(word)] : word; 30 | }, 31 | 32 | learn: function(wordsMap){ 33 | this._words = wordsMap; 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /public/lang/zh-CN.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* 中文版本。 */ 4 | window.SwaggerTranslator.learn({ 5 | "Warning: Deprecated":"Warning: Deprecated", 6 | "Implementation Notes":"注意事项", 7 | "Response Class":"Response Class", 8 | "Status":"Status1", 9 | "Parameters":"请求参数", 10 | "Parameter":"参数", 11 | "Value":"值", 12 | "Description":"说明信息", 13 | "Parameter Type":"参数类型", 14 | "Data Type":"数据类型", 15 | "Response Messages":"响应信息", 16 | "HTTP Status Code":"返回码", 17 | "Reason":"原因", 18 | "Response Model":"响应 Model", 19 | "Request URL":"Request URL", 20 | "Response Body":"Response Body", 21 | "Response Code":"Response Code", 22 | "Response Headers":"Response Headers", 23 | "Headers":"头", 24 | "Hide Response":"隐藏响应", 25 | "Try it out!":"测试", 26 | "Show/Hide":"展开/收起", 27 | "List Operations":"查看列表", 28 | "Expand Operations":"展开所有", 29 | "Raw":"Raw", 30 | "can't parse JSON. Raw result":"can't parse JSON. Raw result", 31 | "Model Schema":"Model Schema", 32 | "Model":"Model", 33 | "apply":"apply", 34 | "Username":"Username", 35 | "Password":"Password", 36 | "Terms of service":"Terms of service", 37 | "Created by":"Created by", 38 | "See more at":"See more at", 39 | "Contact the developer":"联系开发者", 40 | "api version":"api version", 41 | "Response Content Type":"Response Content Type", 42 | "fetching resource":"fetching resource", 43 | "fetching resource list":"fetching resource list", 44 | "Explore":"Explore", 45 | "Show Swagger Petstore Example Apis":"Show Swagger Petstore Example Apis", 46 | "Can't read from server. It may not have the appropriate access-control-origin settings.":"Can't read from server. It may not have the appropriate access-control-origin settings.", 47 | "Please specify the protocol for":"Please specify the protocol for", 48 | "Can't read swagger JSON from":"Can't read swagger JSON from", 49 | "Finished Loading Resource Information. Rendering Swagger UI":"Finished Loading Resource Information. Rendering Swagger UI", 50 | "Unable to read api":"Unable to read api", 51 | "from path":"from path", 52 | "server returned":"server returned", 53 | "Parameter content type:":"参数类型:" 54 | }); 55 | -------------------------------------------------------------------------------- /public/lib/backbone-min.js: -------------------------------------------------------------------------------- 1 | // Backbone.js 1.1.2 2 | 3 | (function(t,e){if(typeof define==="function"&&define.amd){define(["underscore","jquery","exports"],function(i,r,s){t.Backbone=e(t,s,i,r)})}else if(typeof exports!=="undefined"){var i=require("underscore");e(t,exports,i)}else{t.Backbone=e(t,{},t._,t.jQuery||t.Zepto||t.ender||t.$)}})(this,function(t,e,i,r){var s=t.Backbone;var n=[];var a=n.push;var o=n.slice;var h=n.splice;e.VERSION="1.1.2";e.$=r;e.noConflict=function(){t.Backbone=s;return this};e.emulateHTTP=false;e.emulateJSON=false;var u=e.Events={on:function(t,e,i){if(!c(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);r.push({callback:e,context:i,ctx:i||this});return this},once:function(t,e,r){if(!c(this,"once",t,[e,r])||!e)return this;var s=this;var n=i.once(function(){s.off(t,n);e.apply(this,arguments)});n._callback=e;return this.on(t,n,r)},off:function(t,e,r){var s,n,a,o,h,u,l,f;if(!this._events||!c(this,"off",t,[e,r]))return this;if(!t&&!e&&!r){this._events=void 0;return this}o=t?[t]:i.keys(this._events);for(h=0,u=o.length;h").attr(t);this.setElement(r,false)}else{this.setElement(i.result(this,"el"),false)}}});e.sync=function(t,r,s){var n=T[t];i.defaults(s||(s={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:n,dataType:"json"};if(!s.url){a.url=i.result(r,"url")||M()}if(s.data==null&&r&&(t==="create"||t==="update"||t==="patch")){a.contentType="application/json";a.data=JSON.stringify(s.attrs||r.toJSON(s))}if(s.emulateJSON){a.contentType="application/x-www-form-urlencoded";a.data=a.data?{model:a.data}:{}}if(s.emulateHTTP&&(n==="PUT"||n==="DELETE"||n==="PATCH")){a.type="POST";if(s.emulateJSON)a.data._method=n;var o=s.beforeSend;s.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",n);if(o)return o.apply(this,arguments)}}if(a.type!=="GET"&&!s.emulateJSON){a.processData=false}if(a.type==="PATCH"&&k){a.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var h=s.xhr=e.ajax(i.extend(a,s));r.trigger("request",r,h,s);return h};var k=typeof window!=="undefined"&&!!window.ActiveXObject&&!(window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent);var T={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var $=e.Router=function(t){t||(t={});if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var S=/\((.*?)\)/g;var H=/(\(\?)?:\w+/g;var A=/\*\w+/g;var I=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend($.prototype,u,{initialize:function(){},route:function(t,r,s){if(!i.isRegExp(t))t=this._routeToRegExp(t);if(i.isFunction(r)){s=r;r=""}if(!s)s=this[r];var n=this;e.history.route(t,function(i){var a=n._extractParameters(t,i);n.execute(s,a);n.trigger.apply(n,["route:"+r].concat(a));n.trigger("route",r,a);e.history.trigger("route",n,r,a)});return this},execute:function(t,e){if(t)t.apply(this,e)},navigate:function(t,i){e.history.navigate(t,i);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=i.result(this,"routes");var t,e=i.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(I,"\\$&").replace(S,"(?:$1)?").replace(H,function(t,e){return e?t:"([^/?]+)"}).replace(A,"([^?]*?)");return new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return i.map(r,function(t,e){if(e===r.length-1)return t||null;return t?decodeURIComponent(t):null})}});var N=e.History=function(){this.handlers=[];i.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var R=/^[#\/]|\s+$/g;var O=/^\/+|\/+$/g;var P=/msie [\w.]+/;var C=/\/$/;var j=/#.*$/;N.started=false;i.extend(N.prototype,u,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(t==null){if(this._hasPushState||!this._wantsHashChange||e){t=decodeURI(this.location.pathname+this.location.search);var i=this.root.replace(C,"");if(!t.indexOf(i))t=t.slice(i.length)}else{t=this.getHash()}}return t.replace(R,"")},start:function(t){if(N.started)throw new Error("Backbone.history has already been started");N.started=true;this.options=i.extend({root:"/"},this.options,t);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var r=this.getFragment();var s=document.documentMode;var n=P.exec(navigator.userAgent.toLowerCase())&&(!s||s<=7);this.root=("/"+this.root+"/").replace(O,"/");if(n&&this._wantsHashChange){var a=e.$('