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
Most endpoints require JWT authentication. To test them in Swagger UI:
93
+
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.
98
+
99
+
### Deployment
100
+
101
+
1. Merging your PR into develop automatically triggers a GitHub Release
102
+
2. The release triggers a container build workflow that builds and pushes the Docker image
103
+
3.[Go to GitHub Packages](https://github.com/CodeForPhilly/balancer-main/pkgs/container/balancer-main%2Fapp) to find the new image tag
104
+
4. Update newTag in kustomization.yaml [in the cluster repo](https://github.com/CodeForPhilly/cfp-live-cluster/blob/main/balancer/kustomization.yaml)
105
+
5. Open a PR to [cfp-sandbox-cluster](https://github.com/CodeForPhilly/cfp-sandbox-cluster) (or [cfp-live-cluster](https://github.com/CodeForPhilly/cfp-live-cluster))
0 commit comments