From d895d047b3cef7ada1e72ae700e62a9c038ec432 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 21 Mar 2024 12:35:45 -0400 Subject: [PATCH] refactor: add upload size to account pin response --- api/s5/messages.go | 1 + api/s5/s5.go | 1 + api/s5/swagger.yaml | 3 +++ 3 files changed, 5 insertions(+) diff --git a/api/s5/messages.go b/api/s5/messages.go index 845772d..b90bcc0 100644 --- a/api/s5/messages.go +++ b/api/s5/messages.go @@ -127,5 +127,6 @@ type AccountPinResponse struct { type AccountPin struct { Hash string `json:"hash"` + Size uint64 `json:"size"` MimeType string `json:"mime_type"` } diff --git a/api/s5/s5.go b/api/s5/s5.go index 1fb0e53..7e236d7 100644 --- a/api/s5/s5.go +++ b/api/s5/s5.go @@ -858,6 +858,7 @@ func (s *S5API) accountPins(jc jape.Context) { } pins[i] = AccountPin{ Hash: base64Url, + Size: pin.Upload.Size, MimeType: pin.Upload.MimeType, } } diff --git a/api/s5/swagger.yaml b/api/s5/swagger.yaml index 0fa78d1..ad5b46b 100644 --- a/api/s5/swagger.yaml +++ b/api/s5/swagger.yaml @@ -911,10 +911,13 @@ components: type: object required: - hash + - size - mime_type properties: hash: type: string + size: + type: integer mime_type: type: string RegistryQueryResponse: