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
- Configuration in `SPECTACULAR_SETTINGS` in `settings.py`
156
+
- Views use `@extend_schema` decorators and `serializer_class` attributes for schema generation
157
+
- JWT auth is configured in the schema — use `JWT <token>` (not `Bearer`) in Swagger UI's Authorize dialog
158
+
- To document a new endpoint: add `serializer_class` to the view if it has one, or add `@extend_schema` with `inline_serializer` for views returning raw dicts
159
+
150
160
#### Key Data Models
151
161
-**Medication** (`api.views.listMeds.models`) - Medication catalog with benefits/risks
152
162
-**MedRule** (`api.models.model_medRule`) - Include/Exclude rules for medications based on patient history
if grep -q "^$LOCAL_IP[[:space:]]\+$HOSTNAME" /etc/hosts;then
92
-
echo"Entry for $HOSTNAME with IP $LOCAL_IP already exists in /etc/hosts"
93
-
else
94
-
echo"Updating /etc/hosts for $HOSTNAME"
95
-
sudo sed -i "/[[:space:]]$HOSTNAME/d" /etc/hosts
96
-
echo"$LOCAL_IP$HOSTNAME"| sudo tee -a /etc/hosts
97
-
fi
98
-
```
99
-
100
-
### Steps to reproduce
101
-
102
-
Inside root dir of balancer
103
-
104
-
```bash
105
-
devbox shell
106
-
devbox create:cluster
107
-
devbox run deploy:balancer
108
-
```
92
+
Most endpoints require JWT authentication. To test them in Swagger UI:
109
93
110
-
The website should be available in [https://balancertestsite.com:30219/](https://balancertestsite.com:30219/)
94
+
1.**Get a token**: Find the `POST /auth/jwt/create/` endpoint in Swagger UI, click **Try it out**, enter an authorized `email` and `password`, and click **Execute**. Copy the `access` token from the response.
95
+
2.**Authorize**: Click the **Authorize** button (lock icon) at the top of the page. Enter `JWT <your-access-token>` in the value field. The prefix must be `JWT`, not `Bearer`.
96
+
3.**Test endpoints**: All subsequent requests will include your token. Use **Try it out** on any protected endpoint.
97
+
4.**Token refresh**: Access tokens expire after 60 minutes. Use `POST /auth/jwt/refresh/` with your `refresh` token, or repeat step 1.
0 commit comments