fix(bruno): correct JSON syntax in Scan Media Items request

Fix critical bug where library_id variable was not quoted in the request
body, causing invalid JSON that was rejected by the API parser.

Changes:
- Quote library_id variable: {{library_id}} → "{{library_id}}"
- Add explicit Content-Type header
- Update request body format to use proper YAML multi-line string

Root Cause:
- Unquoted UUID in JSON: {"library_id": 551ac19c-896a-...}
- Produced invalid JSON that failed c.Bind() in scanner handler
- Handler returned 400 "invalid request" error

Impact:
- Bruno requests for scanning now work correctly
- API scan endpoint accepts request successfully
- Enables proper testing of scan functionality via Bruno

Testing:
- Verified scan request completes successfully
- Job ID returned correctly
- Scanner processes files as expected

File: bruno/scanner/Scan Media Items.yml
This commit is contained in:
2026-02-24 21:33:16 -05:00
parent 875e4abb46
commit b4421b0500
+20 -3
View File
@@ -2,13 +2,30 @@ info:
name: Scan Media Items (Background)
type: http
seq: 1
http:
method: POST
url: '{{base_url}}/api/scanner/scan'
auth: inherit
url: "{{base_url}}/api/scanner/scan"
headers:
- name: Content-Type
value: application/json
params:
- name: ""
value: ""
type: query
body:
type: json
jsonBody: "{\n \"folder_paths\": [\"/path/to/media\"]"
data: |-
{
"library_id": "{{library_id}}"
}
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
## Scan Media Items (Background)