Inconsistent OpenAPI specification: missing preview_url in /api/assets response
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 158
Description
### Expected Behavior
When calling the HTTP API at `/api/assets/` for uploading a new asset, the server should always return a string for an Asset's `preview_url`, or the specification should be updated to indicate that the field is optional.
### Actual Behavior
I get a response like this:
```json
{
"id": "ddf7839d-ef49-4b7a-9726-1157adabb153",
"name": "my asset",
"asset_hash": "blake3:ee37ae26454e1b892004fcff784a647a9d0e72f57d3c493d8e86d0e1cebdd308",
"size": 44924,
"mime_type": "image/png",
"tags": [
"input",
"world",
"yellow"
],
"user_metadata": {
"filename": "yellow/world/ee37ae26454e1b892004fcff784a647a9d0e72f57d3c493d8e86d0e1cebdd308.png"
},
"preview_id": null,
"created_at": "2026-02-24T18:09:46.268807",
"last_access_time": "2026-02-24T18:09:46.268807",
"created_new": false
}
```
### Steps to Reproduce
```
curl --location 'http://127.0.0.1:8188/api/assets' \
--header 'Content-Type: multipart/form-data' \
--header 'Accept: application/json' \
--header 'X-API-Key: {{apiKey}}' \
--form 'file=@"/C:/Users/aWX1183422/Downloads/left.png"' \
--form 'tags="input,yellow,world"' \
--form 'id="907b95c9-4804-fb24-81c3-2f4215ef124f"' \
--form 'preview_id="8f15b4ed-8e19-1b74-d358-90ef05f5e71b"' \
--form 'name="my asset"' \
--form 'mime_type="image/png"' \
--form 'user_metadata="{}"'
```
Contributor guide
Assessment
This issue has not been assessed yet.