spike: return enums as camelCase strings consistently
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- csharp, openapi
- Lĩnh vực
- api, backend-api-design
Hướng nghiên cứu
Start by tracing JsonSerializerOptionsProvider and the response DTOs and mappers named in the issue: JournalTodosController, ProjectsController, and TaskItemsController. Then inventory status and priority strings across the web, MCP server, plugin text, fixtures, database storage, and OpenAPI output. Deliver a short plan answering the six listed questions, recommending the order relative to #399, and naming follow-up issues; make no production code changes.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Related to #399 (moves Status and Priority into TaskFlow.Contracts). Found while auditing the CLAUDE.md rules for #400.
Problem
The API sends task status and priority in a different casing than it accepts and than its own OpenAPI document describes.
- The JSON enum converter uses the camelCase naming policy (
JsonSerializerOptionsProvider). Any field typed as theStatusorPriorityenum, such as request DTOs, is camelCase on the wire. The generated client types match:Status = 'draft' | 'todo' | 'completed' | 'blocked' | 'inProgress'. - Several response DTOs fill
StatusandPrioritywithenum.ToString()into astringfield (JournalTodosController,ProjectsController,TaskItemsController, and thedetailspayloads on log entries). The converter never runs for those, so responses are PascalCase:"status": "Completed"(confirmed against the live API). - Requests accept either casing, so nothing fails. The cost is code that bridges the two shapes:
- the web has about 36 uses of
normalizeStatusandREQUEST_STATUSand about 25 strict PascalCase comparisons, andsrc/lib/task-status.tsexists mainly to convert between them; - the generated client types responses as
string, so the compiler cannot check status values in responses; - the MCP client matches
"Blocked"and"Completed"withOrdinalIgnoreCase; - eight agent and skill files tell Claude to write PascalCase, which pushes new code toward the workaround.
- the web has about 36 uses of
Target
Return enums as camelCase strings everywhere, through the converter, with the response DTO fields typed as the enum. Then the wire format is consistent, the generated client has real unions for responses, and the casing bridge in the web and the MCP client can go.
PascalCase everywhere (dropping the naming policy) is the alternative if the spike finds a reason camelCase is wrong. Leaving it as it is stays on the table as the cost baseline.
What the spike answers
- Every place that produces or consumes a status or priority string: response DTOs, mappers,
detailspayloads on log entries, the web, the MCP server and plugin text,ux-testfixtures, test fixtures. Give a count and a list. - How the database stores the enums, and whether anything persisted depends on the casing (for example, log entry
detailsalready written with PascalCase). - Rollout order and version skew: the web ships with the API, but the MCP plugin runs from a local install. Which consumers must tolerate both casings during the change, and for how long.
- How this fits with #399: should the enums move into
TaskFlow.Contractsfirst, and should the MCP server adopt the enum (with the same converter) instead of strings? Adopting the enum would also make its comparisons case-insensitive by construction. - OpenAPI: confirm the generated client output for responses after the change and list the diff it would produce.
- Whether the work splits into separate issues (API and contract, web cleanup, MCP cleanup) or is one change, and in what order.
Deliverable
A short plan on this issue: the answers above, a recommended order relative to #399, and the issues to open. No production code changes.
Out of scope
Changing any other field's casing, the property naming policy, or adding API versions.
- Ngôn ngữ chính
- C#
- Star
- 1
- Fork
- 0
- Merge trung bình
- 2 giờ 2 phút
- Pull request đã merge (30 ngày)
- 98
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nevridge/TaskFlow
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
tech-debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của nevridge/TaskFlow
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
juandresrodca/AdminForge#54 ·
-
[辞書] C/C++のプリプロセッサ指令名を英字のままにするĐang mở要トリアージ 辞書
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 86/100
yksr-melt/Meltype#1625 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Docs typoĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
MonoGame/docs.monogame.github.io#328 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
space-wizards/RobustToolbox#7197 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation high priority
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
lachydotmcg/capri-desktop#201 ·
Maintainer thường phản hồi trong vòng 1 ngày