diff --git a/openapi/components/schemas/FormFileUploadRequest.yaml b/openapi/components/schemas/FormFileUploadRequest.yaml new file mode 100644 index 0000000..41de628 --- /dev/null +++ b/openapi/components/schemas/FormFileUploadRequest.yaml @@ -0,0 +1,6 @@ +type: object +description: "A file to upload" +properties: + file: + type: string + format: binary \ No newline at end of file diff --git a/openapi/components/schemas/FormFileUploadResponse.yaml b/openapi/components/schemas/FormFileUploadResponse.yaml new file mode 100644 index 0000000..d0f1789 --- /dev/null +++ b/openapi/components/schemas/FormFileUploadResponse.yaml @@ -0,0 +1,16 @@ +type: object +description: "Form file upload response" +properties: + filename: + description: "file name" + type: string + tempPath: + description: "temporary path of a file" + type: string + contentType: + description: "response content type" + type: string +example: + filename: "66c5d4e99167e.pdf" + tempPath: "885efa7d-c639-4076-ba5d-04a7fbfc1d11.pdf" + contentType: "application/pdf" diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index 358600f..c68e529 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -119,6 +119,10 @@ x-tagGroups: - name: Other tags: - RestAPIextensions + + - name: Upload + tags: + - FormFileUpload tags: - name: Activity x-displayName: Activity @@ -355,6 +359,9 @@ tags: REST API extensions can be used to query business data, Bonita Engine APIs, or an external information system (such as a database, web service, LDAP directory...). They also help to keep a clean separation between the front-end (forms, pages, and interfaces visible to users) and the back-end (processes). externalDocs: url: https://documentation.bonitasoft.com/bonita/latest/rest-api-extensions + - name: FormFileUpload + x-displayName: Form file upload + description: Supports any type of files, used to upload a file before submitting a process or task form with a document in its contract. paths: # ======================= @@ -673,6 +680,11 @@ paths: $ref: './paths/portal@profilesUpload.yaml' /services/profile/import: $ref: './paths/services@profile@import.yaml' + # ======================= + # UPLOAD + # ======================= + /API/formFileUpload: + $ref: './paths/API@formFileUpload.yaml' # TODO : upload endpoints # /portal/processUpload, supports only .bar files @@ -681,7 +693,6 @@ paths: # /portal/connectorImplementation, supports only .zip files (not available in Community edition) # /portal/reportUpload, supports any type of file (not available in Community edition) # /portal/resourceUpload, supports only .jar files (not available in Community edition) -# /API/formFileUpload, supports any type of files, used to upload a file before submitting a process or task form with a document in its contract components: securitySchemes: diff --git a/openapi/paths/API@formFileUpload.yaml b/openapi/paths/API@formFileUpload.yaml new file mode 100644 index 0000000..6acacb6 --- /dev/null +++ b/openapi/paths/API@formFileUpload.yaml @@ -0,0 +1,28 @@ +post: + tags: + - FormFileUpload + summary: Upload a file + description: | + Supports any type of files, used to upload a file before submitting a process or task form with a document in its contract + + operationId: formFileUpload + requestBody: + content: + multipart/form-data: + schema: + $ref: '../components/schemas/FormFileUploadRequest.yaml' + responses: + '200': + description: "Success" + content: + text/plain: + schema: + $ref: '../components/schemas/FormFileUploadResponse.yaml' + '401': + $ref: '../components/responses/Unauthorized.yaml' + '403': + $ref: '../components/responses/Forbidden.yaml' + '400': + $ref: '../components/responses/BadRequest.yaml' + '5XX': + $ref: '../components/responses/ServerError.yaml'