New frontmatter'd docs with handler-compatible shapes:
- get_library_types.md (public; []LibraryTypes)
- list_libraries.md (admin; {data: ListLibrariesRow})
- get_library_folders.md (admin; []LibraryFolders)
- list/get stats/resolve/delete processing issues (admin; family-lens 403s
documented)
- scan_library.md (202 + 409 coalescing with active_job_id)
- get/update scan-settings (ScanSettingsResponse)
Gate improvements forced by this batch:
- Array responses: registered slice -> doc example must be a JSON array; key
set compared against the element type
- RawMessage pins may now be arrays
- update scan-settings uses a RawMessage pin: handler always sets Message but
the struct's omitempty would reject correct docs via zero-value marshal
Registry: sqlc models pinned directly (LibraryTypes, LibraryFolders,
ListLibrariesRow — json tags verified in the generated code).
48 lines
1.1 KiB
Markdown
48 lines
1.1 KiB
Markdown
---
|
||
method: PUT
|
||
path: /api/libraries/scan-settings
|
||
auth: jwt+admin
|
||
area: libraries
|
||
---
|
||
<!-- source: internal/handlers/system_settings.go:210 SystemSettingsHandler.UpdateScanSettings -->
|
||
|
||
# Update Scan Settings
|
||
|
||
Sets the global scan poll interval and auto-scan flag, then reloads the
|
||
settings registry so running code picks the new values up.
|
||
|
||
## Example request
|
||
|
||
```json example-request
|
||
{
|
||
"scan_poll_interval_seconds": 3600,
|
||
"auto_scan_enabled": true
|
||
}
|
||
```
|
||
|
||
## Example response
|
||
|
||
```json example-response
|
||
{
|
||
"scan_poll_interval_seconds": 3600,
|
||
"auto_scan_enabled": true,
|
||
"message": "scan settings updated successfully"
|
||
}
|
||
```
|
||
|
||
## Request fields
|
||
|
||
| Field | Type | Required | Notes |
|
||
| ----- | ---- | -------- | ----- |
|
||
| scan_poll_interval_seconds | number | yes | 1–3600 |
|
||
| auto_scan_enabled | boolean | no | defaults false when omitted |
|
||
|
||
## Errors
|
||
|
||
| Status | Body | When |
|
||
| ------ | ---- | ---- |
|
||
| 400 | `{"error": "..."}` | validation failure |
|
||
| 401 / 403 | — | missing JWT / not an admin |
|
||
| 404 | `{"error": "system setting not found"}` | settings rows missing from DB |
|
||
| 500 | `{"error": "..."}` | unexpected server error |
|