Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(formFileUpload): add formFileUpload documentation #189

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions openapi/components/schemas/FormFileUploadRequest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: object
description: "A file to upload"
properties:
file:
type: string
format: binary
16 changes: 16 additions & 0 deletions openapi/components/schemas/FormFileUploadResponse.yaml
Original file line number Diff line number Diff line change
@@ -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"
13 changes: 12 additions & 1 deletion openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ x-tagGroups:
- name: Other
tags:
- RestAPIextensions

- name: Upload
tags:
- FormFileUpload
tags:
- name: Activity
x-displayName: Activity
Expand Down Expand Up @@ -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:
# =======================
Expand Down Expand Up @@ -673,6 +680,11 @@ paths:
$ref: './paths/[email protected]'
/services/profile/import:
$ref: './paths/services@[email protected]'
# =======================
# UPLOAD
# =======================
/API/formFileUpload:
$ref: './paths/[email protected]'

# TODO : upload endpoints
# /portal/processUpload, supports only .bar files
Expand All @@ -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:
Expand Down
28 changes: 28 additions & 0 deletions openapi/paths/[email protected]
Original file line number Diff line number Diff line change
@@ -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'