title: How to implement selected item in REST API list?
body: <p>I have a standard REST API list of items, each of them accessible on its URI</p>
  
  <pre><code>GET /items/1
  
  {"item":{
      "some":"data",
      "selected":false
  }}
  </code></pre>
  
  <p>Now I want to add a constraint that only one item in the list can be selected. In other words, if one item is selected, all other items should have false in their selected field. Basically it should behave like a radio button group.</p>
  
  <p>I see three options how to implement it, all of them bad</p>
  
  <ol>
  <li>Keep it as it is. If someone updates an item, the server changes the value in previously selected item. This unfortunately makes the resource not cacheable. I update one item but the other one changes its state as well.</li>
  <li>Change the resource so the whole list is one entity. The client updates it at once and it's up to him to make sure that only one item is selected. I do not like this solution, since the items are logically separate entities and I want to access them separately.</li>
  <li>Force the client unselect the previously selected item first and only after that let him to select the new one. It's quite complicated for the client and it can lead to ugly race conditions if more clients are trying to select an item.</li>
  </ol>
  
  <p>Is there a better solution that I do not see?</p>