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:
@@ -2,13 +2,30 @@ info:
|
|||||||
name: Scan Media Items (Background)
|
name: Scan Media Items (Background)
|
||||||
type: http
|
type: http
|
||||||
seq: 1
|
seq: 1
|
||||||
|
|
||||||
http:
|
http:
|
||||||
method: POST
|
method: POST
|
||||||
url: '{{base_url}}/api/scanner/scan'
|
url: "{{base_url}}/api/scanner/scan"
|
||||||
auth: inherit
|
headers:
|
||||||
|
- name: Content-Type
|
||||||
|
value: application/json
|
||||||
|
params:
|
||||||
|
- name: ""
|
||||||
|
value: ""
|
||||||
|
type: query
|
||||||
body:
|
body:
|
||||||
type: json
|
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: |-
|
docs: |-
|
||||||
## Scan Media Items (Background)
|
## Scan Media Items (Background)
|
||||||
|
|||||||
Reference in New Issue
Block a user