Problem
The font deletion endpoint DELETE /api/fonts/:id is implemented in backend/src/font_handlers.rs (handler delete_font) and registered in backend/src/routes.rs, but is not documented in any behavior contract entry in docs/dev/behaviors.md.
Current Font API Documentation
| ID |
Covers |
| API-020 |
POST /api/fonts (upload) + GET /api/fonts / GET /api/fonts/:id (list/get) |
| API-021 |
POST /api/fonts/:id/publish + POST /api/fonts/:id/unpublish |
| API-022 |
GET /fonts/:workspaceSlug/:fontstack/:range (public glyphs) |
Missing: DELETE /api/fonts/:id
Implementation Details (from delete_font handler)
- Authentication: Required
- Workspace isolation: Filters by
currentWorkspaceId
- Behavior:
- Looks up
glyphs_path for the font in the current workspace
- Returns
404 if font not found (or not in workspace)
- Deletes the DB record from
fonts table
- Attempts filesystem cleanup: removes the font directory (
remove_dir_all)
- Path traversal protection: canonical path checked against
upload_dir_canonical
- Response:
204 (no content)
- Errors:
401 (unauthenticated), 404 (not found)
Proposed Action
Either extend API-020 to cover deletion, or add a new entry (e.g., API-020a) documenting:
- The DELETE method on
/api/fonts/:id
- Expected
204 response
- Workspace isolation behavior
- Filesystem cleanup behavior
- Error responses
Priority: P2 — The endpoint works correctly but lacks documentation. Low risk since it follows the same pattern as other delete endpoints.
Problem
The font deletion endpoint
DELETE /api/fonts/:idis implemented inbackend/src/font_handlers.rs(handlerdelete_font) and registered inbackend/src/routes.rs, but is not documented in any behavior contract entry indocs/dev/behaviors.md.Current Font API Documentation
POST /api/fonts(upload) +GET /api/fonts/GET /api/fonts/:id(list/get)POST /api/fonts/:id/publish+POST /api/fonts/:id/unpublishGET /fonts/:workspaceSlug/:fontstack/:range(public glyphs)Missing:
DELETE /api/fonts/:idImplementation Details (from
delete_fonthandler)currentWorkspaceIdglyphs_pathfor the font in the current workspace404if font not found (or not in workspace)fontstableremove_dir_all)upload_dir_canonical204(no content)401(unauthenticated),404(not found)Proposed Action
Either extend API-020 to cover deletion, or add a new entry (e.g., API-020a) documenting:
/api/fonts/:id204responsePriority: P2 — The endpoint works correctly but lacks documentation. Low risk since it follows the same pattern as other delete endpoints.