fix(api): declare sample_maturity.target_count in the response schema #259

Open
opened 2026-10-03 10:45:39 +00:00 by gabogg · 0 comments
Owner

P3 follow-up from PR #243 review pass 2 (both axes).

Finding

PR #243 added sample_maturity.target_count, but SampleMaturityInfo (app/schemas/models.py:526-538) doesn't declare it. The field only reaches the client because of extra="allow", so model_json_schema() and OpenAPI / /api-docs never show it (AGENTS.md §2: contracts live in app/schemas/). is_uncalibrated has the same gap, which predates #243.

  • app.js:3801 mat.target_count ?? 14 keeps a hard-coded 14. The same app serves both the script and the API, so a response without the field can't arrive.

Acceptance Criteria

  • Declare target_count: int (or int | None) and is_uncalibrated on SampleMaturityInfo, and assert that they appear in the OpenAPI schema.
  • Remove the ?? 14 fallback, or point it at one named constant.
P3 follow-up from PR #243 review pass 2 (both axes). ### Finding PR #243 added `sample_maturity.target_count`, but `SampleMaturityInfo` (`app/schemas/models.py:526-538`) doesn't declare it. The field only reaches the client because of `extra="allow"`, so `model_json_schema()` and OpenAPI / `/api-docs` never show it (AGENTS.md §2: contracts live in `app/schemas/`). `is_uncalibrated` has the same gap, which predates #243. - `app.js:3801` `mat.target_count ?? 14` keeps a hard-coded 14. The same app serves both the script and the API, so a response without the field can't arrive. ### Acceptance Criteria - Declare `target_count: int` (or `int | None`) and `is_uncalibrated` on `SampleMaturityInfo`, and assert that they appear in the OpenAPI schema. - Remove the `?? 14` fallback, or point it at one named constant.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gabogg/hikcentral#259
No description provided.