Skip to content

Commit c395bf0

Browse files
committed
Update README.md
1 parent c5b8d92 commit c395bf0

File tree

1 file changed

+2
-76
lines changed

1 file changed

+2
-76
lines changed

README.md

Lines changed: 2 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -7,83 +7,9 @@ Creates a [swagger-ui](https://github.com/wordnik/swagger-ui) page (something li
77
* [ ] Configurable authentication methods
88
* [x] Unit tests
99

10-
## Installation & Usage
10+
# Documentation
1111

12-
Install via Composer:
13-
14-
`$ composer require activelamp/swagger-ui-bundle:0.1.*`
15-
16-
Enable in `app/AppKernel.php`:
17-
18-
```php
19-
<?php
20-
21-
use Symfony\Component\HttpKernel\Kernel;
22-
use Symfony\Component\Config\Loader\LoaderInterface;
23-
24-
class AppKernel extends Kernel
25-
{
26-
public function registerBundles()
27-
{
28-
$bundles = array(
29-
...
30-
new ActiveLAMP\Bundle\SwaggerUIBundle\ALSwaggerUIBundle(),
31-
32-
```
33-
Let it know where to find your API's resource-list JSON:
34-
35-
```
36-
# app/config/config.yml
37-
38-
al_swagger_ui:
39-
resource_list: http://petstore.swagger.wordnik.com/api/api-docs
40-
```
41-
42-
And finally, add the route to `app/config/routing.yml`:
43-
44-
```
45-
al_swagger_ui:
46-
resource: @ALSwaggerUIBundle/Resources/config/routing.yml
47-
prefix: /docs
48-
```
49-
Done!
50-
51-
The swagger-ui page for your REST API should now be served at
52-
`http://yourapp.com/docs`.
53-
54-
### `al_swagger_ui -> resource_list` configuration
55-
56-
The `resource_list` option can receive 2 types of values:
57-
58-
1. An absolute URL to an external Swagger resource-list (demoed above).
59-
2. A route name.
60-
61-
### Serving static JSON files
62-
63-
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:
64-
65-
1. Place all JSON files inside a directory (doesn't have to be public)
66-
2. Register the routes:
67-
68-
```yaml
69-
# app/config/routing.yml
70-
al_swagger_ui_static_resources:
71-
resource: @ALSwaggerUI/Resources/config/static_resources_routing.yml
72-
prefix: /swagger-docs
73-
```
74-
3. Configure the `static_resources` config:
75-
76-
```yaml
77-
al_swagger_ui:
78-
static_resources:
79-
resource_dir: app/Resources/swagger-docs
80-
resource_list_filename: api-docs.json
81-
resource_list: al_swagger_ui_static_resource_list
82-
```
83-
84-
This will result in a `/swagger-docs` route to return the resource-list, and `/swagger-docs/<resource_name>` to serve API declarations.
85-
86-
Setting `resource_list` to `al_swagger_ui_static_resource_list` will then point `swagger-ui` to the right direction.
12+
* [Installation & Basic Usage](https://github.com/bezhermoso/swagger-ui-bundle/blob/master/Resources/doc/index.md)
8713

8814
## Configuration reference
8915

0 commit comments

Comments
 (0)