├── .gitignore ├── ALSwaggerUIBundle.php ├── Controller ├── StaticResourcesController.php └── SwaggerUIController.php ├── DependencyInjection ├── ALSwaggerUIExtension.php └── Configuration.php ├── README.md ├── Resources ├── config │ ├── routing.yml │ ├── services.yml │ └── static_resources_routing.yml ├── doc │ ├── authentication.md │ ├── installation-and-usage.md │ └── overriding-templates.md ├── 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 │ ├── index.html │ ├── 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 └── views │ ├── SwaggerUI │ └── index.html.twig │ └── layout.html.twig ├── Tests ├── Application │ ├── AppKernel.php │ ├── Resources │ │ └── swagger-docs │ │ │ ├── api-docs.json │ │ │ ├── pet.json │ │ │ ├── store.json │ │ │ └── user.json │ └── config │ │ ├── config_external.yml │ │ ├── config_test.yml │ │ └── routing.yml ├── Controller │ ├── StaticResourcesControllerTest.php │ └── SwaggerUIControllerTest.php ├── WebTestCase.php └── bootstrap.php ├── composer.json └── phpunit.xml.dist /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor -------------------------------------------------------------------------------- /ALSwaggerUIBundle.php: -------------------------------------------------------------------------------- 1 | 23 | */ 24 | class StaticResourcesController extends Controller 25 | { 26 | public function resourceListAction(Request $request) 27 | { 28 | $dir = $this->getStaticResourcesDir(); 29 | $baseFilename = $this->getResourceListFilename(); 30 | 31 | try { 32 | $finder = new Finder(); 33 | $files = $finder->in($dir)->files()->name($baseFilename); 34 | 35 | if (count($files) === 0) { 36 | throw new \Exception(sprintf('Cannot find resource list: %s', $baseFilename)); 37 | } 38 | 39 | $files = iterator_to_array($files->getIterator()); 40 | 41 | $resourcesList = json_decode(array_pop($files)->getContents(), JSON_OBJECT_AS_ARRAY); 42 | 43 | foreach ($resourcesList['tags'] as $tag) { 44 | $finder = new Finder(); 45 | 46 | $files = $finder->in($dir)->files()->name(sprintf('%s.json', strtolower($tag['name']))); 47 | $files = iterator_to_array($files->getIterator()); 48 | 49 | $paths = json_decode(array_pop($files)->getContents(), JSON_OBJECT_AS_ARRAY); 50 | 51 | $resourcesList['paths'] = array_merge($resourcesList['paths'], $paths); 52 | } 53 | 54 | $response = new Response(json_encode($resourcesList)); 55 | $response->headers->set('Content-type', 'application/json'); 56 | 57 | return $response; 58 | } catch (\Exception $e) { 59 | throw $this->createNotFoundException($e->getMessage()); 60 | } 61 | 62 | } 63 | 64 | public function apiDeclarationAction(Request $request, $resource) 65 | { 66 | $dir = $this->getStaticResourcesDir(); 67 | $filename = $resource . '.json'; 68 | 69 | try { 70 | 71 | $finder = new Finder(); 72 | $files = $finder->in($dir)->files()->name($filename); 73 | 74 | if (count($files) === 0) { 75 | throw new \Exception(sprintf('Cannot find API declaration: %s', $filename)); 76 | } 77 | 78 | foreach ($files as $file) { 79 | 80 | $data = json_decode($file->getContents(), true); 81 | $data['basePath'] = $request->getBaseUrl() . $data['basePath']; 82 | $response = new JsonResponse($data); 83 | return $response; 84 | } 85 | 86 | } catch (\Exception $e) { 87 | throw $this->createNotFoundException($e->getMessage()); 88 | } 89 | } 90 | 91 | private function getStaticResourcesDir() 92 | { 93 | return $this->get('kernel')->getRootDir() . '/../' . $this->get('service_container')->getParameter('al_swagger_ui.static_resources_dir'); 94 | } 95 | 96 | private function getResourceListFilename() 97 | { 98 | return $this->get('service_container')->getParameter('al_swagger_ui.static_resource_list_filename'); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /Controller/SwaggerUIController.php: -------------------------------------------------------------------------------- 1 | 10 | */ 11 | class SwaggerUIController extends Controller 12 | { 13 | public function indexAction(Request $request) 14 | { 15 | $docUrl = $this->get('service_container')->getParameter('al_swagger_ui.resource_list'); 16 | $jsConfig = $this->get('service_container')->getParameter('al_swagger_ui.js_config'); 17 | $authConfig = $this->get('service_container')->getParameter('al_swagger_ui.auth_config'); 18 | 19 | if (preg_match('/^(https?:)?\/\//', $docUrl)) { 20 | // If https://..., http://..., or //... 21 | $url = $docUrl; 22 | } elseif (strpos($docUrl, '/') === 0) { 23 | //If starts with "/", interpret as an asset. 24 | $url = $this->get('templating.helper.assets')->getUrl($docUrl); 25 | } else { 26 | // else, interpret as route-name. 27 | $url = $this->generateUrl($docUrl); 28 | } 29 | 30 | $url = rtrim($url, '/'); 31 | 32 | return $this->render('ALSwaggerUIBundle:SwaggerUI:index.html.twig', array( 33 | 'resource_list_url' => $url, 34 | 'js_config' => $jsConfig, 35 | 'auth_config' => $authConfig 36 | )); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /DependencyInjection/ALSwaggerUIExtension.php: -------------------------------------------------------------------------------- 1 | processConfiguration($configuration, $configs); 25 | 26 | $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); 27 | $loader->load('services.yml'); 28 | 29 | $container->setParameter('al_swagger_ui.resource_list', $config['resource_list']); 30 | $container->setParameter('al_swagger_ui.js_config', $config['js_config']); 31 | $container->setParameter('al_swagger_ui.auth_config', $config['auth_config']); 32 | 33 | $container->setParameter('al_swagger_ui.static_resources_dir', $config['static_resources']['resource_dir']); 34 | $container->setParameter('al_swagger_ui.static_resource_list_filename', $config['static_resources']['resource_list_filename']); 35 | $container->setParameter('al_swagger_ui.authentication_config', $config['auth_config']); 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /DependencyInjection/Configuration.php: -------------------------------------------------------------------------------- 1 | root('al_swagger_ui'); 22 | 23 | // Here you should define the parameters that are allowed to 24 | // configure your bundle. See the documentation linked above for 25 | // more information on that topic. 26 | 27 | $rootNode->addDefaultsIfNotSet() 28 | ->children() 29 | ->scalarNode('resource_list')->cannotBeEmpty()->isRequired()->end() 30 | ->arrayNode('static_resources') 31 | ->addDefaultsIfNotSet() 32 | ->children() 33 | ->scalarNode('resource_dir')->defaultValue(null)->end() 34 | ->scalarNode('resource_list_filename')->defaultValue('api-docs.json')->end() 35 | ->end() 36 | ->end() 37 | ->arrayNode('js_config') 38 | ->addDefaultsIfNotSet() 39 | ->children() 40 | ->scalarNode('expansion')->defaultValue('list')->end() 41 | ->arrayNode('supported_submit_methods') 42 | ->prototype('scalar')->end() 43 | ->defaultValue(array('get', 'post', 'put', 'delete')) 44 | ->end() 45 | ->scalarNode('sorter')->defaultValue(null)->end() 46 | ->scalarNode('highlight_size_threshold')->defaultValue(null)->end() 47 | ->arrayNode('boolean_values') 48 | ->prototype('scalar')->end() 49 | ->defaultValue(array('true', 'false')) 50 | ->end() 51 | ->end() 52 | ->end() 53 | ->arrayNode('auth_config') 54 | ->addDefaultsIfNotSet() 55 | ->children() 56 | ->arrayNode('oauth') 57 | ->addDefaultsIfNotSet() 58 | ->children() 59 | ->booleanNode('enable')->defaultFalse()->end() 60 | ->scalarNode('client_id')->defaultValue(null)->end() 61 | ->scalarNode('realm')->defaultValue(null)->end() 62 | ->scalarNode('app_name')->defaultValue(null)->end() 63 | ->end() 64 | ->end() 65 | ->arrayNode('http') 66 | ->addDefaultsIfNotSet() 67 | ->children() 68 | ->booleanNode('enable')->defaultFalse()->end() 69 | ->scalarNode('key_name')->defaultValue(null)->end() 70 | ->scalarNode('delivery')->defaultValue(null)->end() 71 | ->end() 72 | ->end() 73 | ->end() 74 | ->end() 75 | ->end(); 76 | 77 | return $treeBuilder; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Swagger UI Bundle 2 | ================= 3 | 4 | Creates a [swagger-ui](https://github.com/wordnik/swagger-ui) page (something like [this](http://petstore.swagger.wordnik.com/)) in your Symfony2 application. 5 | 6 | * [x] Basic functionalities 7 | * [x] Configurable authentication methods 8 | * [x] Unit tests 9 | 10 | #### For Swagger v1.x support, use the `v0.2.1` of this repository. `dev-master` is now using Swagger v2. 11 | 12 | # Documentation 13 | 14 | * [Installation & Usage](https://github.com/activelamp/swagger-ui-bundle/blob/master/Resources/doc/installation-and-usage.md) 15 | * [Authentication](https://github.com/activelamp/swagger-ui-bundle/blob/master/Resources/doc/authentication.md) 16 | * [Overriding templates](https://github.com/activelamp/swagger-ui-bundle/blob/master/Resources/doc/overriding-templates.md) 17 | 18 | ## Configuration reference 19 | 20 | ```yaml 21 | al_swagger_ui: 22 | resource_list: ~ # Required 23 | static_resources: 24 | resource_dir: null 25 | resource_list_filename: api-docs.json 26 | js_config: 27 | expansion: list 28 | supported_submit_methods: [get, post, put, delete] 29 | sorter: null 30 | highlight_size_threshold: null 31 | boolean_values: ['true', 'false'] 32 | auth_config: 33 | oauth: 34 | enable: false 35 | client_id: null 36 | realm: null 37 | app_name: null 38 | http: 39 | enable: false 40 | key_name: null 41 | delivery: null 42 | ``` 43 | -------------------------------------------------------------------------------- /Resources/config/routing.yml: -------------------------------------------------------------------------------- 1 | al_swagger_ui_home: 2 | path: / 3 | defaults: { _controller: ALSwaggerUIBundle:SwaggerUI:index } -------------------------------------------------------------------------------- /Resources/config/services.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | # al_swagger_ui.example.class: ActiveLAMP\Bundle\SwaggerUIBundle\Example 3 | 4 | services: 5 | # al_swagger_ui.example: 6 | # class: %al_swagger_ui.example.class% 7 | # arguments: [@service_id, "plain_value", %parameter%] 8 | -------------------------------------------------------------------------------- /Resources/config/static_resources_routing.yml: -------------------------------------------------------------------------------- 1 | al_swagger_ui_static_resource_list: 2 | path: / 3 | defaults: 4 | _controller: ALSwaggerUIBundle:StaticResources:resourceList 5 | 6 | al_swagger_ui_static_api_declaration: 7 | path: /{resource} 8 | defaults: 9 | _controller: ALSwaggerUIBundle:StaticResources:apiDeclaration -------------------------------------------------------------------------------- /Resources/doc/authentication.md: -------------------------------------------------------------------------------- 1 | Swagger UI Bundle 2 | ================= 3 | 4 | ## Authentication options 5 | 6 | `swagger-ui` supports `http` and `oauth` authentication, and both of these can be easily configured in this bundle: 7 | 8 | 9 | ### OAuth 10 | ``` 11 | al_swagger_ui: 12 | oauth: 13 | enable: true 14 | app_name: "Your app name" 15 | client_id: "unique_client_id" 16 | realm: "your-realms" 17 | ``` 18 | 19 | Coupled with the correct OAuth authentication definition in the Swagger API declarations, an OAuth authentication flow will be presented in the documentation. 20 | 21 | ### HTTP 22 | ``` 23 | al_swagger_ui: 24 | http: 25 | enable: true 26 | key_name: __key 27 | delivery: query 28 | ``` 29 | 30 | This will add an API key field in the documentation page. `delivery` can be set to either `query` or `header`, whichever is applicable to your API authentication protocol. 31 | 32 | __Note that both of these authentication methods can be enabled at the same time.__ 33 | -------------------------------------------------------------------------------- /Resources/doc/installation-and-usage.md: -------------------------------------------------------------------------------- 1 | Swagger UI Bundle 2 | ================= 3 | 4 | ## Installation & Usage 5 | 6 | Install via Composer: 7 | 8 | `$ composer require activelamp/swagger-ui-bundle:0.2.*` 9 | 10 | Enable in `app/AppKernel.php`: 11 | 12 | ```php 13 | resource_list` configuration 48 | 49 | The `resource_list` option can receive 2 types of values: 50 | 51 | 1. An absolute URL to an external Swagger resource-list (demoed above). 52 | 2. A route name. 53 | 54 | ### Serving static JSON files 55 | 56 | If you already have a set of Swagger-compliant JSON files, you can configure this bundle to serve them for you in such a way that `swagger-ui` can consume it properly: 57 | 58 | 1. Place all JSON files inside a directory (doesn't have to be public) 59 | 2. Register the routes: 60 | 61 | ```yaml 62 | # app/config/routing.yml 63 | al_swagger_ui_static_resources: 64 | resource: @ALSwaggerUI/Resources/config/static_resources_routing.yml 65 | prefix: /swagger-docs 66 | ``` 67 | 3. Configure the `static_resources` config: 68 | 69 | ```yaml 70 | al_swagger_ui: 71 | static_resources: 72 | resource_dir: app/Resources/swagger-docs 73 | resource_list_filename: api-docs.json 74 | resource_list: al_swagger_ui_static_resource_list 75 | ``` 76 | 77 | This will result in a `/swagger-docs` route to return the resource-list, and `/swagger-docs/` to serve API declarations. 78 | 79 | Setting `resource_list` to `al_swagger_ui_static_resource_list` will then point `swagger-ui` to the right direction. 80 | -------------------------------------------------------------------------------- /Resources/doc/overriding-templates.md: -------------------------------------------------------------------------------- 1 | Swagger UI Bundle 2 | ================= 3 | 4 | You can override the template used through the usual way, which is creating an `app/Resources/ALSwaggerUIBundle/views/layout.html.twig` file. 5 | 6 | Here are the various Twig blocks that you need to know about: 7 | 8 | `al_swagger_ui_stylesheets` - This block will contain CSS includes related to theming the `div#swagger-ui-container` portion of the documentation. 9 | `al_swagger_ui_javascripts` - This block will contain JS includes and inline scripts that effectively put the `swagger-ui` page into motion. 10 | `al_swagger_ui_content` - This block will contain the necessary HTML fragments (authentication form, `div#swagger-ui-container`, etc) that will hold `swagger-ui`-related elements. 11 | 12 | All these should be present in the overriding Twig template in order for the documentation page to continue to work. 13 | 14 | Example template: 15 | 16 | ```html 17 | {% extends "::layout.html.twig" %} 18 | 19 | {% block stylesheets %} 20 | {{ parent() }} 21 | {% block al_swagger_ui_stylesheets %}{% endblock %} 22 | 25 | {% endblock %} 26 | 27 | {% block javascripts %} 28 | {{ parent() }} 29 | {% block al_swagger_ui_javascripts %}{% endblock %} 30 | {% endblock %} 31 | 32 | {% block body %} 33 |
34 | {% block al_swagger_ui_content %}{% endblock %} 35 |
36 | {% endblock %} 37 | ``` 38 | -------------------------------------------------------------------------------- /Resources/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 | -------------------------------------------------------------------------------- /Resources/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 | -------------------------------------------------------------------------------- /Resources/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 | -------------------------------------------------------------------------------- /Resources/public/fonts/droid-sans-v6-latin-700.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/activelamp/swagger-ui-bundle/3a080d4b81f48e1d6475a2c1d2a130528f93442b/Resources/public/fonts/droid-sans-v6-latin-700.eot -------------------------------------------------------------------------------- /Resources/public/fonts/droid-sans-v6-latin-700.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/activelamp/swagger-ui-bundle/3a080d4b81f48e1d6475a2c1d2a130528f93442b/Resources/public/fonts/droid-sans-v6-latin-700.ttf -------------------------------------------------------------------------------- /Resources/public/fonts/droid-sans-v6-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/activelamp/swagger-ui-bundle/3a080d4b81f48e1d6475a2c1d2a130528f93442b/Resources/public/fonts/droid-sans-v6-latin-700.woff -------------------------------------------------------------------------------- /Resources/public/fonts/droid-sans-v6-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/activelamp/swagger-ui-bundle/3a080d4b81f48e1d6475a2c1d2a130528f93442b/Resources/public/fonts/droid-sans-v6-latin-700.woff2 -------------------------------------------------------------------------------- /Resources/public/fonts/droid-sans-v6-latin-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/activelamp/swagger-ui-bundle/3a080d4b81f48e1d6475a2c1d2a130528f93442b/Resources/public/fonts/droid-sans-v6-latin-regular.eot -------------------------------------------------------------------------------- /Resources/public/fonts/droid-sans-v6-latin-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/activelamp/swagger-ui-bundle/3a080d4b81f48e1d6475a2c1d2a130528f93442b/Resources/public/fonts/droid-sans-v6-latin-regular.ttf -------------------------------------------------------------------------------- /Resources/public/fonts/droid-sans-v6-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/activelamp/swagger-ui-bundle/3a080d4b81f48e1d6475a2c1d2a130528f93442b/Resources/public/fonts/droid-sans-v6-latin-regular.woff -------------------------------------------------------------------------------- /Resources/public/fonts/droid-sans-v6-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/activelamp/swagger-ui-bundle/3a080d4b81f48e1d6475a2c1d2a130528f93442b/Resources/public/fonts/droid-sans-v6-latin-regular.woff2 -------------------------------------------------------------------------------- /Resources/public/images/explorer_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/activelamp/swagger-ui-bundle/3a080d4b81f48e1d6475a2c1d2a130528f93442b/Resources/public/images/explorer_icons.png -------------------------------------------------------------------------------- /Resources/public/images/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/activelamp/swagger-ui-bundle/3a080d4b81f48e1d6475a2c1d2a130528f93442b/Resources/public/images/favicon-16x16.png -------------------------------------------------------------------------------- /Resources/public/images/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/activelamp/swagger-ui-bundle/3a080d4b81f48e1d6475a2c1d2a130528f93442b/Resources/public/images/favicon-32x32.png -------------------------------------------------------------------------------- /Resources/public/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/activelamp/swagger-ui-bundle/3a080d4b81f48e1d6475a2c1d2a130528f93442b/Resources/public/images/favicon.ico -------------------------------------------------------------------------------- /Resources/public/images/logo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/activelamp/swagger-ui-bundle/3a080d4b81f48e1d6475a2c1d2a130528f93442b/Resources/public/images/logo_small.png -------------------------------------------------------------------------------- /Resources/public/images/pet_store_api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/activelamp/swagger-ui-bundle/3a080d4b81f48e1d6475a2c1d2a130528f93442b/Resources/public/images/pet_store_api.png -------------------------------------------------------------------------------- /Resources/public/images/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/activelamp/swagger-ui-bundle/3a080d4b81f48e1d6475a2c1d2a130528f93442b/Resources/public/images/throbber.gif -------------------------------------------------------------------------------- /Resources/public/images/wordnik_api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/activelamp/swagger-ui-bundle/3a080d4b81f48e1d6475a2c1d2a130528f93442b/Resources/public/images/wordnik_api.png -------------------------------------------------------------------------------- /Resources/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Swagger UI 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 102 | 103 | 104 | 105 | 115 | 116 |
 
117 |
118 | 119 | 120 | -------------------------------------------------------------------------------- /Resources/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.$('