Skip to content

Support 21095 Create OpenAPI 3 file for ObjectUpload #75

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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 schema/object-store-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ paths:
$ref: 'object-subtype.yml#/paths/~1v1~1object-subtype'
/v1/object-subtype/{Id}:
$ref: 'object-subtype.yml#/paths/~1v1~1object-subtype~1{Id}'
/v1/object-upload:
$ref: 'object-upload.yml#/paths/~1v1~1object-upload'
/v1/object-upload/{Id}:
$ref: 'object-upload.yml#/paths/~1v1~1object-upload~1{Id}'
/v1/file/{bucket}:
$ref: 'object-upload.yml#/paths/~1v1~1file~1{bucket}'
188 changes: 188 additions & 0 deletions schema/object-upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
paths:
/v1/object-upload:
get:
summary: List object-uploads
operationId: getObjectUploads
description: By passing in query string, user can get available object-uploads authorised
parameters:
- in: query
name: filter[rsql]
description: pass an optional search string for looking up the object-uploads
schema:
type: string
- in: query
name: sort
description: optional sort string, can have sort order such as descending denoted by "-"
schema:
type: string
- in: query
name: page[offset]
description: number of records to skip when paging
schema:
type: integer
format: int32
- in: query
name: page[limit]
description: maximum number of records to return when paging
schema:
type: integer
format: int32
minimum: 0
maximum: 50
responses:
'200':
description: object-uploads satifying the query restrictions
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ObjectUpload'
'400':
description: bad input parameter
'404':
description: object-uploads not found
/v1/object-upload/{Id}:
get:
summary: Get an object-upload
description: Return a single object-upload
operationId: getObjectUploadById
parameters:
- name: Id
in: path
description: ID of object-upload to return
required: true
schema:
type: string
format: uuid
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/ObjectUpload'
"400":
description: Invalid ID supplied
"404":
description: object-upload not found
/v1/file/{bucket}:
post:
summary: Upload a file to minio bucket
operationId: uploadFile
description: Upload a file to minio bucket
parameters:
- name: bucket
in: path
description: bucket of the file
required: true
schema:
type: string
responses:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to define the bucket in the parameters

parameters:
        - name: bucket
          in: path
          description: bucket of the file
          required: true
          schema:
            type: string

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'201':
description: file uploaded
content:
application/json:
schema:
$ref: '#/components/schemas/ObjectUpload'
'400':
description: invalid input, object invalid
'409':
description: A file already exists
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
bucket:
type: string
file:
type: string
format: base64
components:
schemas:
ObjectUpload:
type: object
required:
- data
properties:
data:
type: object
required:
- id
properties:
id:
type: string
format: uuid
allOf:
- $ref: '#/components/schemas/CommonObjectUpload'

NewObjectUpload:
type: object
required:
- data
properties:
data:
type: object
allOf:
- $ref: '#/components/schemas/CommonObjectUpload'
CommonObjectUpload:
type: object
required:
- type
- attributes
properties:
type:
enum: [object-upload]
description: The type of the object-upload data being returned.
attributes:
type: object
required:
- fileIdentifier
- originalFilename
- sha1Hex
- bucket
properties:
fileIdentifier:
type: string
format: uuid
description: uploaded file's uuid
createdBy:
type: string
description: agent who has uploaded the file
createdOn:
type: string
description:
Point in time (ISO 8601 Date/Time) recording when the object-upload was created
originalFilename:
type: string
description: original file name when it is uploaded
sha1Hex:
type: string
description: original file's hex string representing the SHA-1 encoded file content
receivedMediaType:
type: string
description: original file's mediaType as it is received
detectedMediaType:
type: string
description: detected mediaType as by a library
detectedFileExtension:
type: string
description: detected file extenstion
evaluatedMediaType:
type: string
description: evaluated media type
evaluatedFileExtension:
type: string
description: evaluated file extension
sizeInBytes:
type: string
description: file size in bytes
thumbnailIdentifier:
type: string
format: uuid
description: uploaded file's thumbnail identifier
bucket:
type: string
description: bucket name as in minio server storage