[#42161] added additional link to file link model

- https://community.openproject.org/work_packages/42161
- file link read model now contains a link to file location
- some boyscouting in root model, fixed 2 warnings
pull/10570/head
Eric Schubert 3 years ago
parent 7776884149
commit 4e43a4d6c2
No known key found for this signature in database
GPG Key ID: 1D346C019BD4BAA2
  1. 1
      .redocly.lint-ignore.yaml
  2. 24
      docs/api/apiv3/components/schemas/file_link_read_model.yml
  3. 137
      docs/api/apiv3/components/schemas/root_model.yml
  4. 7
      docs/api/apiv3/paths/file_link_open.yml
  5. 41
      docs/api/apiv3/paths/root.yml

@ -5,4 +5,5 @@ tmp/oas-generated.yml:
- '#/paths/~1api~1v3~1work_packages~1{id}~1relations/get/responses' - '#/paths/~1api~1v3~1work_packages~1{id}~1relations/get/responses'
- '#/paths/~1api~1v3~1file_links~1{file_link_id}~1open/get/responses' - '#/paths/~1api~1v3~1file_links~1{file_link_id}~1open/get/responses'
operation-4xx-response: operation-4xx-response:
- '#/paths/~1api~1v3/get/responses'
- '#/paths/~1api~1v3~1work_packages~1{id}~1relations/get/responses' - '#/paths/~1api~1v3~1work_packages~1{id}~1relations/get/responses'

@ -42,6 +42,8 @@ properties:
- creator - creator
- originOpen - originOpen
- staticOriginOpen - staticOriginOpen
- originOpenLocation
- staticOriginOpenLocation
properties: properties:
self: self:
allOf: allOf:
@ -93,6 +95,20 @@ properties:
- description: |- - description: |-
A static uri to open the origin file on the storage. Responds with a redirect. A static uri to open the origin file on the storage. Responds with a redirect.
**Resource**: N/A
originOpenLocation:
allOf:
- $ref: './link.yml'
- description: |-
The uri to open the location of origin file on the origin itself.
**Resource**: N/A
staticOriginOpenLocation:
allOf:
- $ref: './link.yml'
- description: |-
A static uri to open the location of the origin file on the storage. Responds with a redirect.
**Resource**: N/A **Resource**: N/A
example: example:
@ -162,8 +178,14 @@ example:
href: /api/v3/work_package/17/file_links/1337 href: /api/v3/work_package/17/file_links/1337
title: file link delete API title: file link delete API
originOpen: originOpen:
href: https://nextcloud.deathstar.rocks/index.php/f?fileid=5503 href: https://nextcloud.deathstar.rocks/index.php/f?fileid=5503openfile=1
title: file open title: file open
staticOriginOpen: staticOriginOpen:
href: /api/v3/work_package/17/file_links/1337/open href: /api/v3/work_package/17/file_links/1337/open
title: file open title: file open
originOpenLocation:
href: https://nextcloud.deathstar.rocks/index.php/f?fileid=5503&openfile=0
title: file open
staticOriginOpenLocation:
href: /api/v3/work_package/17/file_links/1337/open?location=true
title: file open

@ -1,11 +1,18 @@
# Schema: RootModel # Schema: RootModel
--- ---
type: object type: object
required:
- _type
- instanceName
- _links
properties: properties:
_type:
type: string
enum:
- Root
instanceName: instanceName:
type: string type: string
description: The name of the OpenProject instance description: The name of the OpenProject instance
readOnly: true
coreVersion: coreVersion:
type: string type: string
description: |- description: |-
@ -14,26 +21,124 @@ properties:
# Conditions # Conditions
**Permission** requires admin privileges **Permission** requires admin privileges
_links:
type: object
required:
- self
- configuration
- memberships
- priorities
- relations
- statuses
- time_entries
- types
- user
- userPreferences
- workPackages
properties:
self:
allOf:
- $ref: './link.yml'
- description: |-
This root information object.
**Resource**: Root
configuration:
allOf:
- $ref: './link.yml'
- description: |-
The configuration resource.
**Resource**: Configuration
memberships:
allOf:
- $ref: './link.yml'
- description: |-
The collection of memberships.
**Resource**: Collection
priorities:
allOf:
- $ref: './link.yml'
- description: |-
The collection of priorities.
**Resource**: Collection
relations:
allOf:
- $ref: './link.yml'
- description: |-
The collection of relations.
**Resource**: Collection
statuses:
allOf:
- $ref: './link.yml'
- description: |-
The collection of statuses.
**Resource**: Collection
time_entries:
allOf:
- $ref: './link.yml'
- description: |-
The collection of time entries.
**Resource**: Collection
types:
allOf:
- $ref: './link.yml'
- description: |-
The collection of types.
**Resource**: Collection
user:
allOf:
- $ref: './link.yml'
- description: |-
The current user resource.
**Resource**: User
userPreferences:
allOf:
- $ref: './link.yml'
- description: |-
The current user preferences resource.
**Resource**: UserPreferences
workPackages:
allOf:
- $ref: './link.yml'
- description: |-
The work package collection.
**Resource**: Collection
example: example:
_type: Root
instanceName: OpenProject
coreVersion: 12.1.0
_links: _links:
self:
href: '/api/v3'
configuration: configuration:
href: "/api/v3/configuration" href: '/api/v3/configuration'
user: memberships:
href: "/api/v3/users/1" href: '/api/v3/memberships'
title: John Sheppard
userPreferences:
href: "/api/v3/my_preferences"
priorities: priorities:
href: "/api/v3/priorities" href: '/api/v3/priorities'
relations: relations:
href: "/api/v3/relations" href: '/api/v3/relations'
statuses: statuses:
href: "/api/v3/statuses" href: '/api/v3/statuses'
time_entries:
href: '/api/v3/time_entries'
types: types:
href: "/api/v3/types" href: '/api/v3/types'
user:
href: '/api/v3/users/3'
title: Anakin Skywalker
userPreferences:
href: '/api/v3/users/3/preferences'
workPackages: workPackages:
href: "/api/v3/work_packages" href: '/pi/v3/work_packages'
users:
href: "/api/v3/users"
instanceName: My own OpenProject
coreVersion: 10.3.0

@ -17,6 +17,13 @@ get:
schema: schema:
type: integer type: integer
example: 42 example: 42
- name: location
description: Boolean flag indicating, if the file should be opened directly or rather the directory location.
in: query
required: false
schema:
type: boolean
example: true
responses: responses:
'303': '303':
headers: headers:

@ -1,41 +1,16 @@
# /api/v3 # /api/v3
--- ---
get: get:
summary: View root
operationId: view_root
description: |-
Returns the root resource, containing basic information about the server instance and a collection of useful links.
tags:
- Root
responses: responses:
'200': '200':
description: OK
content: content:
application/hal+json: application/hal+json:
examples:
response:
value:
_links:
configuration:
href: "/api/v3/configuration"
priorities:
href: "/api/v3/priorities"
relations:
href: "/api/v3/relations"
statuses:
href: "/api/v3/statuses"
types:
href: "/api/v3/types"
user:
href: "/api/v3/users/1"
title: John Sheppard
userPreferences:
href: "/api/v3/my_preferences"
users:
href: "/api/v3/users"
workPackages:
href: "/api/v3/work_packages"
coreVersion: 10.3.0
instanceName: My own OpenProject
schema: schema:
"$ref": "../components/schemas/root_model.yml" $ref: '../components/schemas/root_model.yml'
description: OK
headers: {}
tags:
- Root
description: ''
operationId: View_root
summary: View root

Loading…
Cancel
Save