Files
bookhoard/bruno/collections/Bulk Remove Books - Invalid IDs.bru
T
john-okeefe 26070e4000 Refactor: rename baseUrl to base_url in .bru files
Update configuration key naming convention to use snake_case
consistently.
Applies changes recursively across all subdirectories.
2026-02-08 21:26:31 -05:00

60 lines
1.3 KiB
Plaintext

meta {
name: Bulk Remove Books - Invalid IDs
type: http
seq: 4
}
post {
url: {{base_url}}/api/collections/{{collection_id}}/books/bulk-remove
body: json
auth: inherit
}
headers {
Content-Type: application/json
Authorization: Bearer {{authToken}}
}
body:json {
{
"book_ids": [
"{{bookId1}}",
"invalid-uuid-format",
"{{bookId2}}"
]
}
}
script:post-response {
function onResponse(res) {
if (res.getStatus() === 200) {
tests['Partial success accepted'] = true;
const body = res.getBody();
tests['Has removed count'] = body.removed !== undefined;
tests['Has results array'] = Array.isArray(body.results);
}
}
onResponse(res);
}
settings {
encodeUrl: true
timeout: 0
}
docs {
## Bulk Remove Books - Invalid IDs
Tests behavior when the book_ids array contains invalid UUID formats or non-existent books.
**Expected Result:** 200 OK with partial success
**Purpose:** Verifies that:
- Invalid UUID formats don't crash the endpoint
- Non-existent book IDs are handled gracefully
- Valid IDs in the same request are still processed
- Response includes detailed results showing which succeeded/failed
**Note:** The endpoint should process all valid IDs and report failures for invalid ones, allowing clients to handle partial failures appropriately.
}