From 16caef5db1cf85dbc5d3effb340208fdba879715 Mon Sep 17 00:00:00 2001 From: alesan99 Date: Mon, 16 Mar 2026 08:45:38 -0500 Subject: [PATCH 1/2] Add schema to download_all --- specifyweb/backend/attachment_gw/views.py | 44 +++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/specifyweb/backend/attachment_gw/views.py b/specifyweb/backend/attachment_gw/views.py index 92aad2ce428..1182d0c1eed 100644 --- a/specifyweb/backend/attachment_gw/views.py +++ b/specifyweb/backend/attachment_gw/views.py @@ -307,6 +307,50 @@ def proxy(request): (chunk for chunk in response.iter_content(512 * 1024)), content_type=response.headers['Content-Type']) +@openapi(schema={ + "post": { + "requestBody": { + "required": True, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "attachmentlocations": { + "type": "array", + "items": {"type": "string"}, + "description": "URL locations of the attachments to download", + }, + "origfilenames": { + "type": "array", + "items": {"type": "string"}, + "description": "Original attachment filenames of the attachments to be downloaded", + }, + "recordsetid": { + "type": "integer", + "description": "Optional. Will download all attachmends in the recordset. Using this will ignore all other properties.", + }, + }, + "required": ["attachmentlocations", "origfilenames"], + } + } + } + }, + "responses": { + "200": { + "description": "A zip file containing all requested attachments.", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary", + } + } + }, + }, + } + } +}) @require_POST @login_maybe_required @never_cache From 62316da479c3d0925c511eae3014356101eb74a6 Mon Sep 17 00:00:00 2001 From: alesan99 Date: Tue, 17 Mar 2026 13:46:32 -0500 Subject: [PATCH 2/2] Add API schema to series_autonumber_range --- specifyweb/backend/series/views.py | 43 +++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/specifyweb/backend/series/views.py b/specifyweb/backend/series/views.py index 19df5049812..7195b57c4e3 100644 --- a/specifyweb/backend/series/views.py +++ b/specifyweb/backend/series/views.py @@ -9,8 +9,49 @@ from specifyweb.specify.api.crud import get_model from specifyweb.specify.utils.uiformatters import get_uiformatter_by_name -from specifyweb.specify.views import login_maybe_required +from specifyweb.specify.views import login_maybe_required, openapi +@openapi(schema={ + "post": { + "requestBody": { + "required": True, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "rangestart": {"type": "string", "description": "Start value of the range"}, + "rangeend": {"type": "string", "description": "End value of the range"}, + "tablename": {"type": "string", "description": "Table being used (E.g. CollectionObject)"}, + "fieldname": {"type": "string", "description": "Field name being numbered"}, + "formattername": {"type": "string", "description": "UIFormatter name for field"}, + "skipstartnumber": {"type": "boolean", "description": "If true, omit the start value from returned list"} + }, + "required": ["rangestart", "rangeend", "tablename", "fieldname", "formattername"] + } + } + } + }, + "responses": { + "200": { + "description": "List of generated values, along with information about existing numbers and an error message, if any.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "values": {"type": "array", "items": {"type": "string"}}, + "existing": {"type": "array", "items": {"type": "string"}}, + "error": {"type": "string"} + }, + "required": ["values"] + } + } + } + }, + } + } +}) @login_maybe_required @require_POST def series_autonumber_range(request: http.HttpRequest):