meta { name: Test Collection Rules - Empty Rules Array type: http seq: 5 } post { url: {{baseUrl}}/api/collections/test-rules body: json auth: inherit } headers { Content-Type: application/json Authorization: Bearer {{authToken}} } body:json { { "rules": [] } } script:post-response { function onResponse(res) { tests['Empty rules rejected'] = res.getStatus() === 400; } onResponse(res); } settings { encodeUrl: true timeout: 0 } docs { ## Test Collection Rules - Empty Rules Array Tests validation behavior when providing an empty rules array. **Expected Result:** 400 Bad Request **Validation Rule:** rules array must contain at least one rule object. **Purpose:** Ensures the API properly validates input and rejects empty rule sets, preventing accidental queries that would return all books or cause performance issues. **Use Case:** Client-side validation should prevent sending empty rules, but the API should also validate to catch malformed requests. }