refactor: restructure Bruno API collection for consistency
Standardize all Bruno API request files with consistent formatting and structure to improve maintainability and readability. Changes include: - Consolidate URL parameters into main URL instead of separate definitions - Standardize quote style (double quotes throughout) - Add proper settings section with defaults (timeout, redirects, etc.) - Improve YAML formatting with literal style for multi-line content - Remove redundant fields (disabled: false) - Clean up header and body structure - Update sequence numbers for better organization - Add scenarios folder structure for organized test groupings Removes obsolete Search Invalid Library ID test case. Environment configuration updated with new library_id for testing. These changes improve the Bruno collection's maintainability and make it easier to create new API requests following established patterns.
This commit is contained in:
@@ -13,7 +13,7 @@ variables:
|
||||
- name: note_id
|
||||
value: 7710a602-g29b-61d4-c716-446655440002
|
||||
- name: library_id
|
||||
value: 849151fb-564e-4b24-89e3-d11360789576
|
||||
value: 87a6114a-186e-4cf6-bb56-aeb16f5f62a8
|
||||
- name: job_id
|
||||
value: 295654b3-eb4b-4e85-ac6c-9361c5821195
|
||||
- name: rating
|
||||
|
||||
@@ -5,36 +5,29 @@ info:
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: "{{base_url}}/api/media-items/search"
|
||||
url: "{{base_url}}/api/media-items/search?library_id={{library_id}}&q=foundation&author_filter=asimov&genre_filter=scifi&year_min=1950&year_max=2000&sort=title ASC"
|
||||
params:
|
||||
- name: library_id
|
||||
value: "{{library_id}}"
|
||||
type: query
|
||||
disabled: false
|
||||
- name: q
|
||||
value: "foundation"
|
||||
value: foundation
|
||||
type: query
|
||||
disabled: false
|
||||
- name: author_filter
|
||||
value: "asimov"
|
||||
value: asimov
|
||||
type: query
|
||||
disabled: false
|
||||
- name: genre_filter
|
||||
value: "scifi"
|
||||
value: scifi
|
||||
type: query
|
||||
disabled: false
|
||||
- name: year_min
|
||||
value: "1950"
|
||||
type: query
|
||||
disabled: false
|
||||
- name: year_max
|
||||
value: "2000"
|
||||
type: query
|
||||
disabled: false
|
||||
- name: sort
|
||||
value: "title ASC"
|
||||
value: title ASC
|
||||
type: query
|
||||
disabled: false
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
|
||||
@@ -1,22 +1,32 @@
|
||||
info:
|
||||
name: Create Media Item
|
||||
type: http
|
||||
seq: 1
|
||||
seq: 2
|
||||
|
||||
http:
|
||||
method: POST
|
||||
url: '{{base_url}}/api/media-items'
|
||||
auth: inherit
|
||||
url: "{{base_url}}/api/media-items"
|
||||
headers:
|
||||
- name: ""
|
||||
value: application/json
|
||||
body:
|
||||
type: json
|
||||
jsonBody: '"library_id": "{{library_id'
|
||||
headers:
|
||||
- key: Content-Type
|
||||
value: application/json
|
||||
data: ""
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: tests
|
||||
code: "test_create_media_item_success(status, headers, body) {\n if (status\
|
||||
\ !== 201) {\n throw new Error(\"Expected status 201, got \" + status);"
|
||||
- type: tests
|
||||
code: |-
|
||||
test_create_media_item_success(status, headers, body) {
|
||||
if (status !== 201) {
|
||||
throw new Error("Expected status 201, got " + status);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
## Create Media Item
|
||||
|
||||
@@ -1,17 +1,24 @@
|
||||
info:
|
||||
name: Create Media Rating
|
||||
type: http
|
||||
seq: 1
|
||||
seq: 3
|
||||
|
||||
http:
|
||||
method: POST
|
||||
url: '{{base_url}}/api/media-items/{{media_item_id}}/rating'
|
||||
auth: inherit
|
||||
url: "{{base_url}}/api/media-items/{{media_item_id}}/rating"
|
||||
headers:
|
||||
- name: ""
|
||||
value: application/json
|
||||
body:
|
||||
type: json
|
||||
jsonBody: "{\n \"rating\": 8"
|
||||
headers:
|
||||
- key: Content-Type
|
||||
value: application/json
|
||||
data: ""
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
## Create Media Rating
|
||||
|
||||
@@ -1,21 +1,29 @@
|
||||
info:
|
||||
name: Delete Media Item
|
||||
type: http
|
||||
seq: 3
|
||||
seq: 17
|
||||
|
||||
http:
|
||||
method: DELETE
|
||||
url: '{{base_url}}/api/media-items/{{media_item_id}}'
|
||||
auth: inherit
|
||||
body:
|
||||
type: none
|
||||
url: "{{base_url}}/api/media-items/{{media_item_id}}"
|
||||
headers:
|
||||
- key: Content-Type
|
||||
value: application/json
|
||||
- name: ""
|
||||
value: application/json
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: tests
|
||||
code: "test_delete_media_item_success(status, headers, body) {\n if (status\
|
||||
\ !== 204) {\n throw new Error(\"Expected status 204, got \" + status);"
|
||||
- type: tests
|
||||
code: |-
|
||||
test_delete_media_item_success(status, headers, body) {
|
||||
if (status !== 204) {
|
||||
throw new Error("Expected status 204, got " + status);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
## Delete Media Item
|
||||
|
||||
@@ -1,21 +1,29 @@
|
||||
info:
|
||||
name: Delete Media Rating
|
||||
type: http
|
||||
seq: 5
|
||||
seq: 19
|
||||
|
||||
http:
|
||||
method: DELETE
|
||||
url: '{{base_url}}/api/media-items/{{media_item_id}}/rating'
|
||||
auth: inherit
|
||||
body:
|
||||
type: none
|
||||
url: "{{base_url}}/api/media-items/{{media_item_id}}/rating"
|
||||
headers:
|
||||
- key: Content-Type
|
||||
value: application/json
|
||||
- name: ""
|
||||
value: application/json
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: tests
|
||||
code: "test_delete_media_rating_success(status, headers, body) {\n if (status\
|
||||
\ !== 204) {\n throw new Error(\"Expected status 204, got \" + status);"
|
||||
- type: tests
|
||||
code: |-
|
||||
test_delete_media_rating_success(status, headers, body) {
|
||||
if (status !== 204) {
|
||||
throw new Error("Expected status 204, got " + status);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
## Delete Media Rating
|
||||
|
||||
@@ -1,19 +1,23 @@
|
||||
info:
|
||||
name: Download Media Item
|
||||
type: http
|
||||
seq: 1
|
||||
seq: 4
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: '{{baseURL}}/api/media-items/{{bookUUID}}/download'
|
||||
auth: none
|
||||
body:
|
||||
type: none
|
||||
url: "{{base_url}}/api/media-items/{{media_item_id}}/download"
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
## Download Media Item
|
||||
|
||||
|
||||
Download a media item file (EPUB, PDF, etc.) from Bookhoard server.
|
||||
|
||||
|
||||
**Method:** GET
|
||||
|
||||
|
||||
**Endpoint:** /api/media-items/{bookUUID
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
info:
|
||||
name: Exact Match With Quotes
|
||||
type: http
|
||||
seq: 1
|
||||
seq: 5
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: "{{base_url}}/api/media-items/search"
|
||||
url: '{{base_url}}/api/media-items/search?library_id={{library_id}}&q="Foundation and Empire"'
|
||||
params:
|
||||
- name: library_id
|
||||
value: "{{library_id}}"
|
||||
type: query
|
||||
disabled: false
|
||||
- name: q
|
||||
value: "\"Foundation and Empire\""
|
||||
value: '"Foundation and Empire"'
|
||||
type: query
|
||||
disabled: false
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
|
||||
@@ -1,24 +1,21 @@
|
||||
info:
|
||||
name: Field Values Search - Authors
|
||||
type: http
|
||||
seq: 1
|
||||
seq: 6
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: "{{base_url}}/api/media-items/search"
|
||||
url: "{{base_url}}/api/media-items/search?library_id={{library_id}}&author=asimov&limit=50"
|
||||
params:
|
||||
- name: library_id
|
||||
value: "{{library_id}}"
|
||||
type: query
|
||||
disabled: false
|
||||
- name: author
|
||||
value: "asimov"
|
||||
value: asimov
|
||||
type: query
|
||||
disabled: false
|
||||
- name: limit
|
||||
value: "50"
|
||||
type: query
|
||||
disabled: false
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
|
||||
@@ -1,24 +1,21 @@
|
||||
info:
|
||||
name: Field Values Search - Genres
|
||||
type: http
|
||||
seq: 1
|
||||
seq: 7
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: "{{base_url}}/api/media-items/search"
|
||||
url: "{{base_url}}/api/media-items/search?library_id={{library_id}}&genre=sci&limit=50"
|
||||
params:
|
||||
- name: library_id
|
||||
value: "{{library_id}}"
|
||||
type: query
|
||||
disabled: false
|
||||
- name: genre
|
||||
value: "sci"
|
||||
value: sci
|
||||
type: query
|
||||
disabled: false
|
||||
- name: limit
|
||||
value: "50"
|
||||
type: query
|
||||
disabled: false
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
|
||||
@@ -1,24 +1,21 @@
|
||||
info:
|
||||
name: Field Values Search - Languages
|
||||
type: http
|
||||
seq: 1
|
||||
seq: 8
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: "{{base_url}}/api/media-items/search"
|
||||
url: "{{base_url}}/api/media-items/search?library_id={{library_id}}&language=eng&limit=50"
|
||||
params:
|
||||
- name: library_id
|
||||
value: "{{library_id}}"
|
||||
type: query
|
||||
disabled: false
|
||||
- name: language
|
||||
value: "eng"
|
||||
value: eng
|
||||
type: query
|
||||
disabled: false
|
||||
- name: limit
|
||||
value: "50"
|
||||
type: query
|
||||
disabled: false
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
|
||||
@@ -1,24 +1,21 @@
|
||||
info:
|
||||
name: Field Values Search - Series
|
||||
type: http
|
||||
seq: 1
|
||||
seq: 9
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: "{{base_url}}/api/media-items/search"
|
||||
url: "{{base_url}}/api/media-items/search?library_id={{library_id}}&series=foundation&limit=50"
|
||||
params:
|
||||
- name: library_id
|
||||
value: "{{library_id}}"
|
||||
type: query
|
||||
disabled: false
|
||||
- name: series
|
||||
value: "foundation"
|
||||
value: foundation
|
||||
type: query
|
||||
disabled: false
|
||||
- name: limit
|
||||
value: "50"
|
||||
type: query
|
||||
disabled: false
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
info:
|
||||
name: Fuzzy Author Filter
|
||||
type: http
|
||||
seq: 1
|
||||
seq: 10
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: "{{base_url}}/api/media-items/search"
|
||||
url: "{{base_url}}/api/media-items/search?library_id={{library_id}}&author_filter=Conan"
|
||||
params:
|
||||
- name: library_id
|
||||
value: "{{library_id}}"
|
||||
type: query
|
||||
disabled: false
|
||||
- name: author_filter
|
||||
value: "asimov"
|
||||
value: Conan
|
||||
type: query
|
||||
disabled: false
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
info:
|
||||
name: Fuzzy Genre Filter
|
||||
type: http
|
||||
seq: 1
|
||||
seq: 11
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: "{{base_url}}/api/media-items/search"
|
||||
url: "{{base_url}}/api/media-items/search?library_id={{library_id}}&genre_filter=scifi"
|
||||
params:
|
||||
- name: library_id
|
||||
value: "{{library_id}}"
|
||||
type: query
|
||||
disabled: false
|
||||
- name: genre_filter
|
||||
value: "scifi"
|
||||
value: scifi
|
||||
type: query
|
||||
disabled: false
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
|
||||
@@ -1,19 +1,29 @@
|
||||
info:
|
||||
name: Get Media Item
|
||||
type: http
|
||||
seq: 1
|
||||
seq: 12
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: '{{base_url}}/api/media-items/{{media_item_id}}'
|
||||
auth: inherit
|
||||
url: "{{base_url}}/api/media-items/{{media_item_id}}"
|
||||
headers:
|
||||
- key: Content-Type
|
||||
value: application/json
|
||||
- name: ""
|
||||
value: application/json
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: tests
|
||||
code: "test_get_media_item_success(status, headers, body) {\n if (status !==\
|
||||
\ 200) {\n throw new Error(\"Expected status 200, got \" + status);"
|
||||
- type: tests
|
||||
code: |-
|
||||
test_get_media_item_success(status, headers, body) {
|
||||
if (status !== 200) {
|
||||
throw new Error("Expected status 200, got " + status);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
## Get Media Item
|
||||
|
||||
@@ -1,21 +1,29 @@
|
||||
info:
|
||||
name: Get Media Rating
|
||||
type: http
|
||||
seq: 4
|
||||
seq: 18
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: '{{base_url}}/api/media-items/{{media_item_id}}/rating'
|
||||
auth: inherit
|
||||
body:
|
||||
type: none
|
||||
url: "{{base_url}}/api/media-items/{{media_item_id}}/rating"
|
||||
headers:
|
||||
- key: Content-Type
|
||||
value: application/json
|
||||
- name: ""
|
||||
value: application/json
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: tests
|
||||
code: "test_get_media_rating_success(status, headers, body) {\n if (status\
|
||||
\ !== 200) {\n throw new Error(\"Expected status 200, got \" + status);"
|
||||
- type: tests
|
||||
code: |-
|
||||
test_get_media_rating_success(status, headers, body) {
|
||||
if (status !== 200) {
|
||||
throw new Error("Expected status 200, got " + status);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
## Get Media Rating
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
info:
|
||||
name: Search All Libraries
|
||||
type: http
|
||||
seq: 1
|
||||
seq: 13
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: "{{base_url}}/api/media-items/search"
|
||||
url: "{{base_url}}/api/media-items/search?q=foundation&library_id={{library_id}}"
|
||||
params:
|
||||
- name: q
|
||||
value: "foundation"
|
||||
value: foundation
|
||||
type: query
|
||||
disabled: false
|
||||
- name: library_id
|
||||
value: "{{library_id}}"
|
||||
type: query
|
||||
disabled: false
|
||||
- name: author_filter
|
||||
value: ""
|
||||
type: query
|
||||
@@ -44,7 +42,7 @@ http:
|
||||
type: query
|
||||
disabled: true
|
||||
- name: sort
|
||||
value: "title ASC"
|
||||
value: title ASC
|
||||
type: query
|
||||
disabled: true
|
||||
- name: limit
|
||||
@@ -218,4 +216,3 @@ docs: |-
|
||||
2. User-specified sort parameter
|
||||
3. Title (final fallback)
|
||||
- Pagination works correctly with limit/offset
|
||||
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
info:
|
||||
name: Search Invalid Library ID
|
||||
type: http
|
||||
seq: 3
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: "{{base_url}}/api/media-items/search"
|
||||
params:
|
||||
- name: q
|
||||
value: "test"
|
||||
type: query
|
||||
disabled: false
|
||||
- name: library_id
|
||||
value: "invalid-uuid"
|
||||
type: query
|
||||
disabled: false
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
## Search Invalid Library ID
|
||||
|
||||
Tests error handling when an invalid library_id is provided.
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**Endpoint:** /api/media-items/search
|
||||
|
||||
**Authentication:** Required (Bearer token)
|
||||
|
||||
**Query Parameters:**
|
||||
- `q` (string, required): Search query
|
||||
- `library_id` (string, invalid): Malformed UUID
|
||||
|
||||
**Response:** HTTP 400 (Bad Request)
|
||||
```json
|
||||
{
|
||||
"error": "invalid library_id"
|
||||
}
|
||||
```
|
||||
|
||||
**Success Criteria:**
|
||||
- Status: 400
|
||||
- Returns error message indicating invalid library_id
|
||||
|
||||
**Edge Cases Tested:**
|
||||
- Malformed UUID (not valid UUID format)
|
||||
- Validates input sanitization
|
||||
@@ -1,20 +1,18 @@
|
||||
info:
|
||||
name: Search Specific Library
|
||||
type: http
|
||||
seq: 2
|
||||
seq: 15
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: "{{base_url}}/api/media-items/search"
|
||||
url: "{{base_url}}/api/media-items/search?q=beo&library_id={{library_id}}"
|
||||
params:
|
||||
- name: q
|
||||
value: "harry"
|
||||
value: beo
|
||||
type: query
|
||||
disabled: false
|
||||
- name: library_id
|
||||
value: "{{libraryId}}"
|
||||
value: "{{library_id}}"
|
||||
type: query
|
||||
disabled: false
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
|
||||
@@ -1,46 +1,32 @@
|
||||
info:
|
||||
name: Update Media Item
|
||||
type: http
|
||||
seq: 2
|
||||
seq: 16
|
||||
|
||||
http:
|
||||
method: PUT
|
||||
url: '{{base_url}}/api/media-items/{{media_item_id}}'
|
||||
auth: inherit
|
||||
url: "{{base_url}}/api/media-items/{{media_item_id}}"
|
||||
headers:
|
||||
- name: ""
|
||||
value: application/json
|
||||
body:
|
||||
type: json
|
||||
json:
|
||||
title: Updated Media Item Title
|
||||
author: Updated Author Name
|
||||
isbn: 978-9876543210
|
||||
description: Updated description
|
||||
cover_image_path: /updated/path/to/cover.jpg
|
||||
series: Updated Series Name
|
||||
series_number: 2
|
||||
tags:
|
||||
- updated
|
||||
- fiction
|
||||
- adventure
|
||||
asin: B09XYZ789
|
||||
date_published: '2023-02-20'
|
||||
publisher: Updated Publisher
|
||||
contributors:
|
||||
- Updated Contributor
|
||||
language: en
|
||||
edition: Updated Edition
|
||||
page_count: 400
|
||||
genre: Updated Genre
|
||||
copyright_year: 2023
|
||||
goodreads_id: '7890123'
|
||||
openlibrary_id: OL789012M
|
||||
google_books_id: GB789012
|
||||
headers:
|
||||
- key: Content-Type
|
||||
value: application/json
|
||||
data: ""
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: tests
|
||||
code: "test_update_media_item_success(status, headers, body) {\n if (status\
|
||||
\ !== 200) {\n throw new Error(\"Expected status 200, got \" + status);"
|
||||
- type: tests
|
||||
code: |-
|
||||
test_update_media_item_success(status, headers, body) {
|
||||
if (status !== 200) {
|
||||
throw new Error("Expected status 200, got " + status);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
## Update Media Item
|
||||
|
||||
@@ -1,42 +1,51 @@
|
||||
info:
|
||||
name: Update Media Rating
|
||||
type: http
|
||||
seq: 1
|
||||
seq: 14
|
||||
|
||||
http:
|
||||
method: PUT
|
||||
url: '{{base_url}}/api/media-items/{{media_item_id}}/rating'
|
||||
auth: inherit
|
||||
url: "{{base_url}}/api/media-items/{{media_item_id}}/rating"
|
||||
headers:
|
||||
- name: ""
|
||||
value: application/json
|
||||
body:
|
||||
type: json
|
||||
jsonBody: "{\n \"rating\": 4,\n \"review\": \"Great book! Very enjoyable\
|
||||
\ read.\""
|
||||
headers:
|
||||
- key: Content-Type
|
||||
value: application/json
|
||||
data: ""
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: tests
|
||||
code: "test_update_media_rating_success(status, headers, body) {\n if (status\
|
||||
\ !== 200) {\n throw new Error(\"Expected status 200, got \" + status);"
|
||||
- type: tests
|
||||
code: |-
|
||||
test_update_media_rating_success(status, headers, body) {
|
||||
if (status !== 200) {
|
||||
throw new Error("Expected status 200, got " + status);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
## Update Media Rating
|
||||
|
||||
|
||||
Updates an existing rating for a media item.
|
||||
|
||||
|
||||
**Method:** PUT
|
||||
|
||||
|
||||
**Endpoint:** /api/media-items/:id/rating
|
||||
|
||||
|
||||
**Authentication:** Required (Bearer token)
|
||||
|
||||
|
||||
**Path Parameters:**
|
||||
- `id` (string, required): Media item UUID
|
||||
|
||||
|
||||
**Request Body:**
|
||||
- `rating` (number, required): Rating value (typically 1-5)
|
||||
- `review` (string, optional): Review text
|
||||
|
||||
|
||||
**Response:** Updated rating object
|
||||
- `id` (string): Rating ID
|
||||
- `media_item_id` (string): Media item UUID
|
||||
@@ -44,7 +53,7 @@ docs: |-
|
||||
- `review` (string): Review text
|
||||
- `created_at` (string): Creation timestamp
|
||||
- `updated_at` (string): Last update timestamp
|
||||
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 400: Invalid request body
|
||||
|
||||
@@ -2,18 +2,20 @@ info:
|
||||
name: List Media Items
|
||||
type: http
|
||||
seq: 1
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: '{{base_url}}/api/media-items?library_id={{library_id}}&limit=20&offset=0'
|
||||
auth: inherit
|
||||
url: "{{base_url}}/api/media-items?library_id={{library_id}}&limit=20&offset=0"
|
||||
headers:
|
||||
- key: Content-Type
|
||||
value: application/json
|
||||
runtime:
|
||||
scripts:
|
||||
- type: tests
|
||||
code: "test_list_media_items_success(status, headers, body) {\n if (status\
|
||||
\ !== 200) {\n throw new Error(\"Expected status 200, got \" + status);"
|
||||
- name: ""
|
||||
value: application/json
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
## List Media Items
|
||||
|
||||
@@ -2,19 +2,20 @@ info:
|
||||
name: Search Media Items
|
||||
type: http
|
||||
seq: 1
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: '{{base_url}}/api/media-items/search?q=harry'
|
||||
auth: inherit
|
||||
url: "{{base_url}}/api/media-items/search?q=harry"
|
||||
headers:
|
||||
- key: Content-Type
|
||||
value: application/json
|
||||
runtime:
|
||||
scripts:
|
||||
- type: tests
|
||||
code: "test_search_media_items_success(status, headers, body) {\n if (status\
|
||||
\ !== 200 && status !== 404) {\n throw new Error(\"Expected status 200\
|
||||
\ or 404, got \" + status);"
|
||||
- name: ""
|
||||
value: application/json
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
## Search Media Items
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
info:
|
||||
name: scenarios
|
||||
type: folder
|
||||
seq: 20
|
||||
|
||||
request: {}
|
||||
Reference in New Issue
Block a user