We solved the issue with deletion of policy instances using an autoincrementing instance ID
Currently a delete and replace will increment the instance ID so we need to update the API to facilitate updating an policy with the instance id,
suggest that the entity/{id}/policies PUT payload performs an UPDATE if an optional instance id is present in the policy payload and INSERTS new one otherwise.
POST will probably eventually be removed as it performs a replace on all policies (DELETE/INSERT) and so the instance id should never be present in this payload
Otherwise we could allow update a single entity creating another endpoint, but i prefer first option
e.g. entity/{id}/policies/{id}?instance=x
We solved the issue with deletion of policy instances using an autoincrementing instance ID
Currently a delete and replace will increment the instance ID so we need to update the API to facilitate updating an policy with the instance id,
suggest that the entity/{id}/policies PUT payload performs an UPDATE if an optional instance id is present in the policy payload and INSERTS new one otherwise.
POST will probably eventually be removed as it performs a replace on all policies (DELETE/INSERT) and so the instance id should never be present in this payload
Otherwise we could allow update a single entity creating another endpoint, but i prefer first option e.g. entity/{id}/policies/{id}?instance=x