--- key: api.put-replace-index-order title: 2026-07 — PUT-replace list endpoints derive `Index` from array order; alternate-schedules last row = catch-all default status: active since: 2026-07 supersedes: none superseded-by: none rule: PUT-replace-the-whole-list endpoints derive each item's `Index` from its request-array position, never a client-supplied field; alternate-schedule/playout-template rows are evaluated in `Index` order with the least-conditional row placed last as the catch-all default. signals: '`ReplaceScheduleItemsRequest.ToCommand`, `IAlternateScheduleItem`, first-match-wins · paths: `AlternateScheduleSelector.cs` · issues: #179' mechanics: 'PR #179, `AlternateScheduleSelector.cs`' --- For "replace the whole list" endpoints (PUT over a collection — schedule items, template items, etc.), the item's `Index` is derived from its position in the request array, not from a client-supplied index/order field — established by `ReplaceScheduleItemsRequest.ToCommand` (`Items.Select((item, index) => item.ToReplaceCommand(index))`). Separately, `ProgramScheduleAlternate` and `PlayoutTemplate` rows (both `IAlternateScheduleItem`) are evaluated in `Index` order, first-match-wins; the convention is to place the least-conditional (or unconditional) row **last** so it acts as the catch-all default. Established by the alternate-schedules work (PR #179, `AlternateScheduleSelector.cs`).