Overview
| Artifact ID: | a224bf31467d103bac0818e13651afe9703b64a6763ae6c7a21a0f91fa04e11f |
|---|---|
| Ticket: | 9e71cc1513f505341c36aae5e97fb6cb3e9669c7
validate default= is published in op docs but never applied to a JSON body |
| User & Date: | zeitgeist on 2026-09-19 17:37:38 |
Changes
- icomment:
Fixed by landing `e2a0b712`, deployed — option 2 from this ticket: the codec change, so all 185 ops get it at once. This one is verified by tests, not on production, and I'm saying so up front. Every op carrying a `default=` is either a GET, where defaults already worked, or a write that would change real state (`team.member`, adding a mirror). I didn't want to make a real change just to observe one. What the tests cover, through the real router: - an omitted field takes its declared default (bool `default=1` -> true, int `default=50` -> 50) - an explicit zero is kept: `{"listed": false, "limit": 0}` comes through as false and 0 - a key sent in different case still counts as present: `{"Listed": false}`. `encoding/json` matches field names without regard to case, so a case-sensitive check would have overwritten this value. I confirmed this test fails when the lowercasing is removed. - a pointer field stays nil, which keeps the upsert's "you didn't mention it" meaning intact - the form path behaves as before Whether a field is absent is decided from the keys actually in the body, not by checking whether the decoded value is zero. - mimetype: "text/x-markdown"
- resolution changed to: "Fixed"
- status changed to: "Closed"