mirror of
https://github.com/rommapp/romm.git
synced 2026-11-28 17:48:31 +01:00
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>