From d7fb286332a061e78c6206ad6b1c6bf2fe4fa093 Mon Sep 17 00:00:00 2001 From: Marius Date: Mon, 7 Apr 2025 17:27:25 +0200 Subject: [PATCH] fix(attachments): update references to attachment with previous re-structure --- common/schemas/Attachment.openapi.yaml | 23 +++++++++++++++++++++++ tools/attachment/attachment.openapi.yaml | 24 ++++++++++++------------ 2 files changed, 35 insertions(+), 12 deletions(-) diff --git a/common/schemas/Attachment.openapi.yaml b/common/schemas/Attachment.openapi.yaml index 014080b..ec91144 100644 --- a/common/schemas/Attachment.openapi.yaml +++ b/common/schemas/Attachment.openapi.yaml @@ -195,3 +195,26 @@ components: sha256: type: string description: The SHA256 hash of the chunk + + AttachmentFormData: + required: + - file + - attachment + properties: + file: + format: binary + description: The file to upload + type: string + attachment: + $ref: "#/components/schemas/AttachmentBase" + + AttachmentChunkForm: + required: + - data + properties: + data: + format: binary + description: The file to upload + type: string + chunk: + $ref: "#/components/schemas/Chunk" diff --git a/tools/attachment/attachment.openapi.yaml b/tools/attachment/attachment.openapi.yaml index 1c35e42..29ac4b0 100644 --- a/tools/attachment/attachment.openapi.yaml +++ b/tools/attachment/attachment.openapi.yaml @@ -64,7 +64,7 @@ paths: content: text/event-stream: schema: - $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/Attachment" + $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/AttachmentBase" example: |- data:{"id":"987b8913-f7df-4af0-9bcd-c593d1d43497","date":"2023-04-10T07:22:24.510+00:00","text":"string","@baseType":"Note","@type":"Note"} data:{"id":"987b8913-f7df-4af0-9bcd-c593d1d43498","date":"2023-04-10T07:22:24.510+00:00","text":"string","@baseType":"Note","@type":"Note"} @@ -74,7 +74,7 @@ paths: schema: type: array items: - $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/Attachment" + $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/AttachmentBase" "400": $ref: "../../common/responses/errors.openapi.yaml#/components/responses/Error-400" "401": @@ -141,7 +141,7 @@ paths: content: application/json: schema: - $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/AttachmentMultipart" + $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/AttachmentMultiPart" multipart/form-data: schema: $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/AttachmentFormData" @@ -157,7 +157,7 @@ paths: application/json: schema: allOf: - - $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/Attachment" + - $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/AttachmentBase" headers: ETag: $ref: "../../common/utils/update.openapi.yaml#/components/headers/ETag" @@ -174,7 +174,7 @@ paths: content: application/json: schema: - $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/Attachment" + $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/AttachmentBase" headers: ETag: $ref: "../../common/utils/update.openapi.yaml#/components/headers/ETag" @@ -240,7 +240,7 @@ paths: content: application/json: schema: - $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/AttachmentMultipart" + $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/AttachmentMultiPart" multipart/form-data: schema: $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/AttachmentFormData" @@ -286,7 +286,7 @@ paths: content: application/json: schema: - $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/Attachment" + $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/AttachmentBase" headers: ETag: $ref: "../../common/utils/update.openapi.yaml#/components/headers/ETag" @@ -318,7 +318,7 @@ paths: content: application/json: schema: - $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/Attachment" + $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/AttachmentBase" parameters: - $ref: "../../common/utils/update.openapi.yaml#/components/parameters/If-Match" responses: @@ -327,7 +327,7 @@ paths: content: application/json: schema: - $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/Attachment" + $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/AttachmentBase" "400": $ref: "../../common/responses/errors.openapi.yaml#/components/responses/Error-400" "401": @@ -418,14 +418,14 @@ paths: content: application/json: schema: - $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/AttachmentMultipart" + $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/AttachmentMultiPart" responses: "200": description: OK content: application/json: schema: - $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/AttachmentMultipart" + $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/AttachmentMultiPart" "400": $ref: "../../common/responses/errors.openapi.yaml#/components/responses/Error-400" "401": @@ -494,7 +494,7 @@ paths: content: application/json: schema: - $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/AttachmentMultipart" + $ref: "../../common/schemas/Attachment.openapi.yaml#/components/schemas/AttachmentMultiPart" "400": $ref: "../../common/responses/errors.openapi.yaml#/components/responses/Error-400" "401":