Problem
PATCH /places/{id}/accessibility accepts null on a top-level section (e.g. {"entrance": null}) to clear it entirely, but individual scalar fields inside a section (e.g. entrance.is_level) are typed as plain boolean/enum in the OpenAPI schema, not nullable. Sending {"entrance": {"is_level": null}} returns a 400 validation error.
Confirmed directly against a local run:
curl -X PATCH .../places/{id}/accessibility -d '{"entrance":{"is_level":null}}'
# -> 400
Impact
Once a friend sets a field (e.g. "De plain-pied = Oui"), there's no way to walk it back to "unknown" for just that field — only nulling the entire section and losing every other field in it.
Fix
- Mark individual scalar fields nullable in the OpenAPI schema, same treatment as the section-level pointers.
- Change the corresponding Go struct fields to nullable types (e.g.
*bool) so null vs "omitted" are distinguishable and pass validation.
- Confirm the merge-patch logic applies
null at the field level (clears just that field) rather than only at the section level.
Context
Found while building inwheel-web's accessibility form (search-and-accessibility-form slice). See inwheel-web issue for the corresponding frontend follow-up once this lands.
Problem
PATCH /places/{id}/accessibilityacceptsnullon a top-level section (e.g.{"entrance": null}) to clear it entirely, but individual scalar fields inside a section (e.g.entrance.is_level) are typed as plainboolean/enum in the OpenAPI schema, not nullable. Sending{"entrance": {"is_level": null}}returns a 400 validation error.Confirmed directly against a local run:
Impact
Once a friend sets a field (e.g. "De plain-pied = Oui"), there's no way to walk it back to "unknown" for just that field — only nulling the entire section and losing every other field in it.
Fix
*bool) sonullvs "omitted" are distinguishable and pass validation.nullat the field level (clears just that field) rather than only at the section level.Context
Found while building
inwheel-web's accessibility form (search-and-accessibility-form slice). See inwheel-web issue for the corresponding frontend follow-up once this lands.