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
Add the following to `urls.py`, to expose the schema at `/openapi`. This can be consumed by (Swagger UI)[https://swagger.io/tools/swagger-ui/] or other tools.
960
+
```python
961
+
from rest_framework.schemas import get_schema_view
962
+
from rest_framework_json_api.schemas.openapi import SchemaGenerator
963
+
964
+
...
965
+
966
+
urlpatterns = [
967
+
path('openapi', get_schema_view(
968
+
title="Example API",
969
+
description="API for all things …",
970
+
version="1.0.0",
971
+
generator_class=SchemaGenerator
972
+
), name='openapi-schema'),
973
+
...
974
+
]
975
+
```
976
+
### Get Schema on Command Line
957
977
To generate an OAS schema document, use something like:
0 commit comments