[#43694] added endpoint spec for storage files

pull/11158/head
Eric Schubert 2 years ago
parent e598003250
commit 9f42ddfd5e
No known key found for this signature in database
GPG Key ID: 1D346C019BD4BAA2
  1. 56
      docs/api/apiv3/components/schemas/file_collection_model.yml
  2. 4
      docs/api/apiv3/openapi-spec.yml
  3. 4
      docs/api/apiv3/paths/storage.yml
  4. 48
      docs/api/apiv3/paths/storage_files.yml

@ -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

@ -353,6 +353,8 @@ paths:
"$ref": "./paths/status.yml"
"/api/v3/storages/{id}":
"$ref": "./paths/storage.yml"
"/api/v3/storages/{id}/files":
"$ref": "./paths/storage_files.yml"
"/api/v3/time_entries":
"$ref": "./paths/time_entries.yml"
"/api/v3/time_entries/{id}/form":
@ -552,6 +554,8 @@ components:
"$ref": "./components/schemas/example_schema_model.yml"
Execute_custom_action:
"$ref": "./components/schemas/execute_custom_action.yml"
FileCollectionModel:
$ref: './components/schemas/file_collection_model.yml'
FileLinkCollectionReadModel:
$ref: './components/schemas/file_link_collection_read_model.yml'
FileLinkCollectionWriteModel:

@ -1,8 +1,8 @@
# /api/v3/storages/{id}
---
get:
summary: Gets a file link.
operationId: Get_Storage
summary: Gets a storage.
operationId: get_storage
tags:
- File links
description: |-

@ -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…
Cancel
Save