Skip to content

Commit f127c7f

Browse files
nWidartdunglas
authored andcommitted
Documenting how to have swagger on custom uri (#377)
Documenting how to have swagger on custom uri This adds some documentation on how to keep the api on one endpoint, and move swagger ui to a different one.
1 parent cdb73a5 commit f127c7f

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

core/swagger.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,28 @@ Will produce the following Swagger documentation:
179179
}
180180
}
181181
```
182+
183+
## Changing the Swagger UI Location
184+
185+
Sometimes you may want to have the API at one location, and the Swagger UI at a different location. This can be done by disabling the Swagger UI from the API Platform configuration file and manually adding the Swagger UI controller.
186+
187+
### Disabling Swagger UI
188+
189+
```yaml
190+
# app/config/config.yml
191+
192+
api_platform:
193+
# ...
194+
enable_swagger_ui: false
195+
```
196+
197+
### Manually Registering the Swagger UI Controller
198+
199+
```yaml
200+
# app/config/routing.yml
201+
swagger_ui:
202+
path: /docs
203+
controller: api_platform.swagger.action.ui
204+
```
205+
206+
Change `/docs` to your desired URI you wish Swagger to be accessible on.

0 commit comments

Comments
 (0)