[#43694] added endpoint spec for storage files
parent
e598003250
commit
9f42ddfd5e
@ -0,0 +1,56 @@ |
||||
# Schema: FileCollectionModel |
||||
--- |
||||
allOf: |
||||
- $ref: './collection_model.yml' |
||||
- type: object |
||||
required: |
||||
- _links |
||||
- _embedded |
||||
properties: |
||||
_links: |
||||
type: object |
||||
required: |
||||
- self |
||||
properties: |
||||
self: |
||||
allOf: |
||||
- $ref: "./link.yml" |
||||
- description: |- |
||||
This file links collection |
||||
|
||||
**Resource**: FileLinkCollectionReadModel |
||||
_embedded: |
||||
type: object |
||||
required: |
||||
- elements |
||||
properties: |
||||
elements: |
||||
type: array |
||||
items: |
||||
$ref: './file_link_origin_data_model.yml' |
||||
|
||||
example: |
||||
_type: Collection |
||||
total: 2 |
||||
count: 2 |
||||
_links: |
||||
self: |
||||
href: '/api/v3/storages/42/files' |
||||
_embedded: |
||||
elements: |
||||
- id: 1337 |
||||
name: logo.png |
||||
mimeType: image/png |
||||
size: 16042 |
||||
createdAt: '2021-12-19T09:42:10.170Z' |
||||
lastModifiedAt: '2021-12-20T14:00:13.987Z' |
||||
createdByName: Luke Skywalker |
||||
lastModifiedByName: Anakin Skywalker |
||||
- id: 1338 |
||||
name: README.md |
||||
mimeType: text/markdown |
||||
size: 3742 |
||||
createdAt: '2021-12-20T09:42:10.170Z' |
||||
lastModifiedAt: '2021-12-21T14:00:13.987Z' |
||||
createdByName: Leia Organa |
||||
lastModifiedByName: Leia Organa |
@ -0,0 +1,48 @@ |
||||
# /api/v3/storages/{id}/files |
||||
--- |
||||
get: |
||||
summary: Gets files of a storage. |
||||
operationId: get_storage_files |
||||
tags: |
||||
- File links |
||||
description: |- |
||||
Gets a collection of file data from a storage. When giving no `root` context, the result is the content of the |
||||
document root. With `root` context given, the result contains the collections of file data from without the given |
||||
root file id. |
||||
parameters: |
||||
- name: id |
||||
description: Storage id |
||||
in: path |
||||
required: true |
||||
schema: |
||||
type: integer |
||||
example: 1337 |
||||
- name: root |
||||
description: Root file id |
||||
in: query |
||||
required: false |
||||
schema: |
||||
type: integer |
||||
example: 53 |
||||
responses: |
||||
'200': |
||||
description: OK |
||||
content: |
||||
application/hal+json: |
||||
schema: |
||||
$ref: '../components/schemas/file_collection_model.yml' |
||||
'404': |
||||
content: |
||||
application/hal+json: |
||||
schema: |
||||
$ref: "../components/schemas/error_response.yml" |
||||
example: |
||||
_type: Error |
||||
errorIdentifier: urn:openproject-org:api:v3:errors:NotFound |
||||
message: The requested resource could not be found. |
||||
description: |- |
||||
Returned in either of those cases: |
||||
- if the storage does not exist or the client does not have sufficient permissions to see it |
||||
|
||||
**Required permission:** view file links |
||||
- if the document root file id do not exist on the storage |
Loading…
Reference in new issue