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.
69 lines
1.6 KiB
YAML
69 lines
1.6 KiB
YAML
info:
|
|
name: Fuzzy Genre Filter
|
|
type: http
|
|
seq: 11
|
|
|
|
http:
|
|
method: GET
|
|
url: "{{base_url}}/api/media-items/search?library_id={{library_id}}&genre_filter=scifi"
|
|
params:
|
|
- name: library_id
|
|
value: "{{library_id}}"
|
|
type: query
|
|
- name: genre_filter
|
|
value: scifi
|
|
type: query
|
|
auth: inherit
|
|
|
|
settings:
|
|
encodeUrl: true
|
|
timeout: 0
|
|
followRedirects: true
|
|
maxRedirects: 5
|
|
|
|
docs: |-
|
|
## Fuzzy Genre Filter
|
|
|
|
Filters media items by genre using fuzzy matching (tolerates typos and variations).
|
|
|
|
**Method:** GET
|
|
|
|
**Endpoint:** /api/media-items/search
|
|
|
|
**Authentication:** Required (Bearer token)
|
|
|
|
**Query Parameters:**
|
|
- `library_id` (string, required): Library UUID to search within
|
|
- `genre_filter` (string, required): Genre to fuzzy match (e.g., "scifi" matches "Sci-Fi", "Science Fiction")
|
|
|
|
**How Fuzzy Matching Works:**
|
|
- Uses PostgreSQL pg_trgm word_similarity()
|
|
- Threshold: 0.3 (30% similarity)
|
|
- Handles variations: "scifi" → "Sci-Fi", "Science Fiction"
|
|
- Handles typos: "fantacy" → "Fantasy"
|
|
- Case-insensitive
|
|
|
|
**Response:** HTTP 200 (OK)
|
|
```json
|
|
[
|
|
{
|
|
"id": "uuid",
|
|
"title": "Foundation",
|
|
"author": "Asimov, Isaac",
|
|
"genre": "Sci-Fi",
|
|
"library_id": "uuid",
|
|
"library_name": "E-Books"
|
|
}
|
|
]
|
|
```
|
|
|
|
**Examples:**
|
|
- `genre_filter=scifi` → Matches "Sci-Fi", "Science Fiction"
|
|
- `genre_filter=fantasy` → Matches "Fantasy", "High Fantasy"
|
|
- `genre_filter=mystery` → Matches "Mystery", "Mystery/Thriller"
|
|
|
|
**Success Criteria:**
|
|
- Status: 200
|
|
- Returns items with genres similar to the filter
|
|
- Results sorted by similarity score
|