Files
romm/backend/utils
Georges-Antoine Assi cffe65971e refactor(saves): take rom_ids as a repeated query param
Comma-separated ID params in this codebase are a download-route convention
(/roms/download, and the two file_ids params), built by hand for URLs the
browser navigates to. Every JSON API route that takes a list of IDs repeats
the parameter instead, and roms' platform_ids documents that form explicitly.
GET /api/saves is a JSON route, so it should match those.

Declare the scope once as a shared RomIdScope annotation: the cap and the
positive-ID rule become schema constraints that both routes enforce alike and
that now appear in the OpenAPI schema as maxItems and exclusiveMinimum, so
clients can read the limits instead of discovering them from an error. That
drops the hand-rolled parser and the two validation-to-HTTPException
translations; a bad scope is a 422 on both routes.

One semantic change: the query param can no longer express an explicit empty
scope, since an omitted parameter is the only empty form. Negotiate keeps it,
as a JSON body can still send [].

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-29 16:24:45 -04:00
..
2025-09-04 11:17:00 -03:00
2026-06-21 17:42:25 -04:00
2026-07-26 15:16:56 -04:00
2026-08-01 14:52:55 -04:00
2026-07-20 08:39:34 -04:00
2026-06-28 21:48:50 -04:00
2026-07-06 22:17:56 -04:00
2026-07-19 15:05:51 -04:00