Letters API: every cover letter's language comes back empty #437
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#437
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found on 2026-09-29 in a read-only review of postulo at
95348908d, comparing the API's output schemas with the dictionaries that fill them, and reading a letter back through the test client.Checked again on 2026-10-01 against
mainat0a5cad587: still present.The fix for #283 added
languagetoLetterOut, with a comment saying only the schema had forgotten it. The dictionary the router builds still has nolanguagekey, so the schema's default""is sent for every letter:GET /api/v1/lettersandGET /api/v1/letters/{id}say that no letter has a language, even when one is set._cv_outin the same file does include it, so CVs are right.api/routers/documents.py:51-63,_letter_out(used bylist_letters,get_letteranddraft_letter);api/schemas.py:559-569,LetterOut, wherelanguage: str = ""hides the missing key rather than failing on it.language = "de"comes back fromGET /api/v1/letters/{id}, and in the list, as"language": ""(checked against the snapshot)."language": letter.languageto_letter_out. Consider dropping the= ""default onLetterOut.language(andCVOut.language), so a router that forgets the key fails its tests instead of sending a plausible blank.Done when
tests/test_api.pymakes a letter withlanguage="de"and asserts"language": "de"fromGET /api/v1/letters/{id}and fromGET /api/v1/letters.