spec: update api consistency

Align optimistic locking conflict payload, update websocket docs, and adjust tests.
This commit is contained in:
beabigegg
2026-01-11 16:54:28 +08:00
parent f5f870da56
commit 2cb591ef23
9 changed files with 131 additions and 7 deletions

View File

@@ -88,7 +88,11 @@ class TestOptimisticLocking:
)
assert response.status_code == 409
assert "conflict" in response.json().get("detail", "").lower() or "version" in response.json().get("detail", "").lower()
detail = response.json().get("detail")
assert isinstance(detail, dict)
assert detail.get("error") == "conflict"
assert detail.get("current_version") == 5
assert detail.get("provided_version") == 1
def test_update_without_version_succeeds(self, client, admin_token, db):
"""Test that update without version (for backward compatibility) still works."""