From ea7a4a73214de5b74fc0a5235b6ea16f10770104 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sun, 2 Aug 2026 17:02:20 -0700 Subject: [PATCH] API docs, add to schema test --- docs/api.md | 1 + src/documents/tests/test_api_schema.py | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/api.md b/docs/api.md index b8ba5fc35..a298803cf 100644 --- a/docs/api.md +++ b/docs/api.md @@ -227,6 +227,7 @@ Version-aware endpoints: - `PATCH /api/documents/{id}/`: content updates target the selected version (`?version={version_id}`) or latest version by default; non-content metadata updates target the root document. - `GET /api/documents/{id}/download/`, `GET /api/documents/{id}/preview/`, `GET /api/documents/{id}/thumb/`, `GET /api/documents/{id}/metadata/`: accept `?version={version_id}`. - `POST /api/documents/{id}/update_version/`: uploads a new version using multipart form field `document` and optional `version_label`. +- `POST /api/documents/merge_as_versions/`: merges existing top-level documents as versions of a selected root. The JSON body must contain `documents` (at least two document IDs) and `root_document_id` (one of those IDs). The root retains its metadata and permissions; source documents with existing versions are rejected. - `PATCH /api/documents/{id}/versions/{version_id}/`: updates the `version_label` of a specific version. - `DELETE /api/documents/{root_id}/versions/{version_id}/`: deletes a non-root version. diff --git a/src/documents/tests/test_api_schema.py b/src/documents/tests/test_api_schema.py index ca47490e3..886e4bceb 100644 --- a/src/documents/tests/test_api_schema.py +++ b/src/documents/tests/test_api_schema.py @@ -48,6 +48,7 @@ class TestApiSchema(APITestCase): self.assertIn("/api/documents/reprocess/", paths) self.assertIn("/api/documents/rotate/", paths) self.assertIn("/api/documents/merge/", paths) + self.assertIn("/api/documents/merge_as_versions/", paths) self.assertIn("/api/documents/edit_pdf/", paths) self.assertIn("/api/documents/remove_password/", paths)