You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: core/swagger.md
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -179,3 +179,28 @@ Will produce the following Swagger documentation:
179
179
}
180
180
}
181
181
```
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