Merge pull request #10570 from opf/implementation/42161-api-add-open-file-in-location-links

[#42161] added additional link to file link model
pull/10575/head
Andreas Pfohl 3 years ago committed by GitHub
commit 222e2660fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .redocly.lint-ignore.yaml
  2. 30
      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~1file_links~1{file_link_id}~1open/get/responses'
operation-4xx-response:
- '#/paths/~1api~1v3/get/responses'
- '#/paths/~1api~1v3~1work_packages~1{id}~1relations/get/responses'

@ -42,6 +42,8 @@ properties:
- creator
- originOpen
- staticOriginOpen
- originOpenLocation
- staticOriginOpenLocation
properties:
self:
allOf:
@ -93,6 +95,20 @@ properties:
- description: |-
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
example:
@ -148,22 +164,22 @@ example:
_links:
self:
href: /api/v3/work_package/17/file_links/1337
title: file link
storage:
href: /api/v3/storage/42
title: storage
title: It's no moon
container:
href: /api/v3/work_package/17
title: work package
title: Develop API
creator:
href: /api/v3/users/33
title: Obi-Wan Kenobi
delete:
href: /api/v3/work_package/17/file_links/1337
title: file link delete API
originOpen:
href: https://nextcloud.deathstar.rocks/index.php/f?fileid=5503
title: file open
href: https://nextcloud.deathstar.rocks/index.php/f/5503?openfile=1
staticOriginOpen:
href: /api/v3/work_package/17/file_links/1337/open
title: file open
originOpenLocation:
href: https://nextcloud.deathstar.rocks/index.php/f/5503?openfile=0
staticOriginOpenLocation:
href: /api/v3/work_package/17/file_links/1337/open?location=true

@ -1,11 +1,18 @@
# Schema: RootModel
---
type: object
required:
- _type
- instanceName
- _links
properties:
_type:
type: string
enum:
- Root
instanceName:
type: string
description: The name of the OpenProject instance
readOnly: true
coreVersion:
type: string
description: |-
@ -14,26 +21,124 @@ properties:
# Conditions
**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:
_type: Root
instanceName: OpenProject
coreVersion: 12.1.0
_links:
self:
href: '/api/v3'
configuration:
href: "/api/v3/configuration"
user:
href: "/api/v3/users/1"
title: John Sheppard
userPreferences:
href: "/api/v3/my_preferences"
href: '/api/v3/configuration'
memberships:
href: '/api/v3/memberships'
priorities:
href: "/api/v3/priorities"
href: '/api/v3/priorities'
relations:
href: "/api/v3/relations"
href: '/api/v3/relations'
statuses:
href: "/api/v3/statuses"
href: '/api/v3/statuses'
time_entries:
href: '/api/v3/time_entries'
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:
href: "/api/v3/work_packages"
users:
href: "/api/v3/users"
instanceName: My own OpenProject
coreVersion: 10.3.0
href: '/pi/v3/work_packages'

@ -17,6 +17,13 @@ get:
schema:
type: integer
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:
'303':
headers:

@ -1,41 +1,16 @@
# /api/v3
---
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:
'200':
description: OK
content:
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:
"$ref": "../components/schemas/root_model.yml"
description: OK
headers: {}
tags:
- Root
description: ''
operationId: View_root
summary: View root
$ref: '../components/schemas/root_model.yml'

Loading…
Cancel
Save