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 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):