Harden export preview handling
GeoIntel CI / docs-smoke (push) Has been cancelled
GeoIntel CI / contract-smoke (push) Has been cancelled

This commit is contained in:
Codex
2026-06-17 07:04:07 +02:00
parent 21b84dae6c
commit ff21911ac5
10 changed files with 111 additions and 15 deletions
+13 -5
View File
@@ -1010,14 +1010,22 @@ Returns one persisted export record.
### GET `/api/v1/exports/{export_id}/content`
Returns the stored JSON artifact content through the standard API envelope.
HTML report artifacts are intentionally download-only through `/download`.
Calling `/content` for `project_report_html` returns:
```text
code: EXPORT_CONTENT_UNSUPPORTED
message: Export content preview is only available for JSON and GeoJSON artifacts. Download HTML report artifacts instead.
```
### GET `/api/v1/exports/{export_id}/download`
Downloads the stored JSON/GeoJSON export artifact as a raw file response with
`application/json` content type and a `Content-Disposition` attachment
filename. This endpoint intentionally does not use the JSON envelope because
it is a browser/file-download path; callers that need canonical API JSON should
use `/content`.
Downloads the stored JSON/GeoJSON/HTML export artifact as a raw file response
with a `Content-Disposition` attachment filename. JSON and GeoJSON artifacts
use `application/json`; HTML report artifacts use `text/html`. This endpoint
intentionally does not use the JSON envelope because it is a browser/file-download
path; callers that need canonical API JSON should use `/content` for JSON/GeoJSON
artifacts.
### POST `/api/v1/exports/yolo`