Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[#48966] added api specifications for grid models

Eric Schubertc0e9184be0b8
diff --git a/docs/api/apiv3/components/examples/grid-simple-collection-response.yml b/docs/api/apiv3/components/examples/grid-simple-collection-response.yml
new file mode 100644
index 00000000000..692e36c854c
--- /dev/null
+++ b/docs/api/apiv3/components/examples/grid-simple-collection-response.yml
@@ -0,0 +1,47 @@
+# Example: Simple grid collection response
+---
+value:
+ _type: Collection,
+ total: 1,
+ count: 1,
+ pageSize: 30,
+ offset: 1,
+ _embedded:
+ elements:
+ - _type: Grid
+ id: 2
+ rowCount: 8
+ columnCount: 5
+ widgets:
+ - _type: GridWidget
+ identifier: time_entries_current_user
+ startRow: 1
+ endRow: 8
+ startColumn: 1
+ endColumn: 3
+ - _type: GridWidget
+ identifier: news
+ startRow: 3
+ endRow: 8
+ startColumn: 4
+ endColumn: 5
+ - _type: GridWidget
+ identifier: documents
+ startRow: 1
+ endRow: 3
+ startColumn: 3
+ endColumn: 6
+ createdAt: '2018-12-03T16:58:30Z'
+ updatedAt: '2018-12-13T19:36:40Z'
+ _links:
+ scope:
+ href: "/my/page"
+ type: text/html
+ updateImmediately:
+ href: "/api/v3/grids/2"
+ method: patch
+ update:
+ href: "/api/v3/grids/2/form"
+ method: post
+ self:
+ href: "/api/v3/grids/2"
diff --git a/docs/api/apiv3/components/examples/grid-simple-patch-model.yml b/docs/api/apiv3/components/examples/grid-simple-patch-model.yml
new file mode 100644
index 00000000000..c55100e676a
--- /dev/null
+++ b/docs/api/apiv3/components/examples/grid-simple-patch-model.yml
@@ -0,0 +1,26 @@
+# Example: Simple grid patch model
+---
+value:
+ rowCount: 1
+ columnCount: 2
+ widgets:
+ - _type: GridWidget
+ identifier: tasks
+ startRow: 1
+ endRow: 2
+ startColumn: 1
+ endColumn: 2
+ options:
+ name: 'Tasks'
+ - _type: GridWidget
+ identifier: news
+ startRow: 1
+ endRow: 2
+ startColumn: 2
+ endColumn: 3
+ options:
+ name: 'News'
+ _links:
+ scope:
+ href: "/my/page"
+ type: text/html
diff --git a/docs/api/apiv3/components/examples/grid-simple-response.yml b/docs/api/apiv3/components/examples/grid-simple-response.yml
new file mode 100644
index 00000000000..a5478c53df5
--- /dev/null
+++ b/docs/api/apiv3/components/examples/grid-simple-response.yml
@@ -0,0 +1,48 @@
+# Example: Simple grid response
+---
+value:
+ _type: Grid
+ id: 2
+ rowCount: 8
+ columnCount: 5
+ widgets:
+ - _type: GridWidget
+ identifier: tasks
+ startRow: 1
+ endRow: 8
+ startColumn: 1
+ endColumn: 3
+ - _type: GridWidget
+ identifier: news
+ startRow: 3
+ endRow: 8
+ startColumn: 4
+ endColumn: 5
+ - _type: GridWidget
+ identifier: documents
+ startRow: 1
+ endRow: 3
+ startColumn: 3
+ endColumn: 6
+ createdAt: '2018-12-03T16:58:30Z'
+ updatedAt: '2018-12-13T19:36:40Z'
+ _links:
+ self:
+ href: "/api/v3/grids/2"
+ attachments:
+ href: "/api/v3/grids/2/attachments"
+ addAttachment:
+ href: "/api/v3/grids/2/attachments"
+ method: post
+ scope:
+ href: "/my/page"
+ type: text/html
+ updateImmediately:
+ href: "/api/v3/grids/2"
+ method: patch
+ update:
+ href: "/api/v3/grids/2/form"
+ method: post
+ delete:
+ href: "/api/v3/grids/2"
+ method: delete
diff --git a/docs/api/apiv3/components/schemas/collection_model.yml b/docs/api/apiv3/components/schemas/collection_model.yml
index 1905b499fca..38d2f25718d 100644
--- a/docs/api/apiv3/components/schemas/collection_model.yml
+++ b/docs/api/apiv3/components/schemas/collection_model.yml
@@ -1,22 +1,33 @@
# Schema: CollectionModel
---
type: object
+required:
+ - _type
+ - total
+ - count
+ - _links
properties:
+ _type:
+ type: string
+ enum:
+ - Collection
total:
type: integer
- description: The total amount of elements available in the collection
- pageSize:
- type: integer
- description: Amount of elements that a response will hold
+ description: The total amount of elements available in the collection.
+ minimum: 0
count:
type: integer
- description: Actual amount of elements in this response
- offset:
- type: integer
- description: The page number that is requested from paginated collection
- groups:
- type: object
- description: Summarized information about aggregation groups
- totalSums:
+ description: Actual amount of elements in this response.
+ minimum: 0
+ _links:
type: object
- description: Aggregations of supported values for elements of the collection
+ required:
+ - self
+ properties:
+ self:
+ allOf:
+ - $ref: './link.yml'
+ - description: |-
+ This collection resource.
+
+ **Resource**: Collection
diff --git a/docs/api/apiv3/components/schemas/grid_collection_model.yml b/docs/api/apiv3/components/schemas/grid_collection_model.yml
new file mode 100644
index 00000000000..d90a89f4863
--- /dev/null
+++ b/docs/api/apiv3/components/schemas/grid_collection_model.yml
@@ -0,0 +1,17 @@
+# Schema: GridCollectionModel
+---
+allOf:
+ - $ref: './paginated_collection_model.yml'
+ - type: object
+ required:
+ - _embedded
+ properties:
+ _embedded:
+ type: object
+ required:
+ - elements
+ properties:
+ elements:
+ type: array
+ items:
+ $ref: './grid_read_model.yml'
diff --git a/docs/api/apiv3/components/schemas/grid_model.yml b/docs/api/apiv3/components/schemas/grid_model.yml
deleted file mode 100644
index 4db9afb3369..00000000000
--- a/docs/api/apiv3/components/schemas/grid_model.yml
+++ /dev/null
@@ -1,120 +0,0 @@
-# Schema: GridModel
----
-type: object
-properties:
- id:
- type: integer
- description: Grid's id
- readOnly: true
- exclusiveMinimum: 0
- rowCount:
- type: integer
- description: The number of rows the grid has
- exclusiveMinimum: 0
- columnCount:
- type: integer
- description: The number of columns the grid has
- exclusiveMinimum: 0
- widgets:
- type: array
- description: |-
- The set of `GridWidget`s selected for the grid
-
- # Conditions
-
- The widgets cannot overlap
- items:
- type: object
- createdAt:
- type: string
- format: date-time
- description: The time the grid was created
- readOnly: true
- updatedAt:
- type: string
- format: date-time
- description: The time the grid was last updated
- readOnly: true
- _links:
- type: object
- required:
- - self
- - page
- properties:
- updateImmediately:
- allOf:
- - "$ref": "./link.yml"
- - description: |-
- Directly perform edits on this grid
-
- # Conditions
-
- **Permission**: depends on the page the grid is defined for
- readOnly: true
- update:
- allOf:
- - "$ref": "./link.yml"
- - description: |-
- Validate edits on the grid via a form resource before committing
-
- # Conditions
-
- **Permission**: depends on the page the grid is defined for
- readOnly: true
- self:
- allOf:
- - "$ref": "./link.yml"
- - description: |-
- This grid
-
- **Resource**: Grid
- readOnly: true
- page:
- allOf:
- - "$ref": "./link.yml"
- - description: |-
- The url of the page the grid is defined for
-
- **Resource**: url
-
- # Conditions
-
- The page cannot be changed after the creation
-example:
- _type: Grid
- id: 2
- rowCount: 8
- columnCount: 5
- widgets:
- - _type: GridWidget
- identifier: time_entries_current_user
- startRow: 1
- endRow: 8
- startColumn: 1
- endColumn: 3
- - _type: GridWidget
- identifier: news
- startRow: 3
- endRow: 8
- startColumn: 4
- endColumn: 5
- - _type: GridWidget
- identifier: documents
- startRow: 1
- endRow: 3
- startColumn: 3
- endColumn: 6
- createdAt: '2018-12-03T16:58:30Z'
- updatedAt: '2018-12-13T19:36:40Z'
- _links:
- scope:
- href: "/my/page"
- type: text/html
- updateImmediately:
- href: "/api/v3/grids/2"
- method: patch
- update:
- href: "/api/v3/grids/2/form"
- method: post
- self:
- href: "/api/v3/grids/2"
diff --git a/docs/api/apiv3/components/schemas/grid_read_model.yml b/docs/api/apiv3/components/schemas/grid_read_model.yml
new file mode 100644
index 00000000000..4817411521f
--- /dev/null
+++ b/docs/api/apiv3/components/schemas/grid_read_model.yml
@@ -0,0 +1,96 @@
+# Schema: GridReadModel
+---
+type: object
+required:
+ - _type
+ - id
+ - rowCount
+ - columnCount
+ - widgets
+ - _links
+properties:
+ _type:
+ type: string
+ enum:
+ - Grid
+ id:
+ type: integer
+ description: Grid's id
+ minimum: 1
+ rowCount:
+ type: integer
+ description: The number of rows the grid has
+ minimum: 1
+ columnCount:
+ type: integer
+ description: The number of columns the grid has
+ minimum: 1
+ widgets:
+ type: array
+ description: |-
+ The set of `GridWidget`s selected for the grid.
+
+ # Conditions
+
+ - The widgets must not overlap.
+ items:
+ $ref: './grid_widget_model.yml'
+ createdAt:
+ type: string
+ format: date-time
+ description: The time the grid was created.
+ updatedAt:
+ type: string
+ format: date-time
+ description: The time the grid was last updated.
+ _links:
+ type: object
+ required:
+ - self
+ - scope
+ properties:
+ self:
+ allOf:
+ - $ref: './link.yml'
+ - description: |-
+ This grid.
+
+ **Resource**: Grid
+ attachments:
+ allOf:
+ - $ref: './link.yml'
+ - description: |-
+ The attachment collection of this grid.
+
+ **Resource**: AttachmentCollection
+ addAttachment:
+ allOf:
+ - $ref: './link.yml'
+ - description: Link for adding an attachment to this grid.
+ scope:
+ allOf:
+ - $ref: './link.yml'
+ - description: |-
+ The location where this grid is used, usually represented as a relative URL.
+ updateImmediately:
+ allOf:
+ - $ref: './link.yml'
+ - description: |-
+ Directly perform edits on this grid.
+
+ # Conditions
+
+ **Permission**: depends on the page the grid is defined for
+ update:
+ allOf:
+ - $ref: './link.yml'
+ - description: |-
+ Validate edits on the grid via a form resource before committing
+
+ # Conditions
+
+ **Permission**: depends on the page the grid is defined for
+ delete:
+ allOf:
+ - $ref: './link.yml'
+ - description: Deletes this grid resource.
diff --git a/docs/api/apiv3/components/schemas/grid_widget_model.yml b/docs/api/apiv3/components/schemas/grid_widget_model.yml
new file mode 100644
index 00000000000..b8778aa8d40
--- /dev/null
+++ b/docs/api/apiv3/components/schemas/grid_widget_model.yml
@@ -0,0 +1,43 @@
+# Schema: GridWidgetModel
+---
+type: object
+required:
+ - _type
+ - id
+ - identifier
+ - startRow
+ - endRow
+ - startColumn
+ - endColumn
+properties:
+ _type:
+ type: string
+ enum:
+ - GridWidget
+ id:
+ type:
+ - integer
+ - "null"
+ description: The grid widget's unique identifier. Can be null, if a new widget is created within a grid.
+ minimum: 1
+ identifier:
+ type: string
+ description: An alternative, human legible, and unique identifier.
+ startRow:
+ type: integer
+ description: The index of the starting row of the widget. The row is inclusive.
+ minimum: 1
+ endRow:
+ type: integer
+ description: The index of the ending row of the widget. The row is exclusive.
+ minimum: 1
+ startColumn:
+ type: integer
+ description: The index of the starting column of the widget. The column is inclusive.
+ minimum: 1
+ endColumn:
+ type: integer
+ description: The index of the ending column of the widget. The column is exclusive.
+ minimum: 1
+ options:
+ type: object
diff --git a/docs/api/apiv3/components/schemas/grid_write_model.yml b/docs/api/apiv3/components/schemas/grid_write_model.yml
new file mode 100644
index 00000000000..e1645ec903b
--- /dev/null
+++ b/docs/api/apiv3/components/schemas/grid_write_model.yml
@@ -0,0 +1,30 @@
+# Schema: GridWriteModel
+---
+type: object
+properties:
+ rowCount:
+ type: integer
+ description: The number of rows the grid has
+ minimum: 1
+ columnCount:
+ type: integer
+ description: The number of columns the grid has
+ minimum: 1
+ widgets:
+ type: array
+ description: |-
+ The set of `GridWidget`s selected for the grid.
+
+ # Conditions
+
+ - The widgets must not overlap.
+ items:
+ $ref: './grid_widget_model.yml'
+ _links:
+ type: object
+ properties:
+ scope:
+ allOf:
+ - $ref: './link.yml'
+ - description: |-
+ The location where this grid is used, usually represented as a relative URL.
diff --git a/docs/api/apiv3/components/schemas/paginated_collection_model.yml b/docs/api/apiv3/components/schemas/paginated_collection_model.yml
new file mode 100644
index 00000000000..bf4ac4a5591
--- /dev/null
+++ b/docs/api/apiv3/components/schemas/paginated_collection_model.yml
@@ -0,0 +1,37 @@
+# Schema: PaginatedCollectionModel
+---
+allOf:
+ - $ref: './collection_model.yml'
+ - type: object
+ required:
+ - pageSize
+ - offset
+ properties:
+ pageSize:
+ type: integer
+ description: Amount of elements that a response will hold.
+ minimum: 0
+ offset:
+ type: integer
+ description: The page number that is requested from paginated collection.
+ minimum: 1
+ _links:
+ type: object
+ required:
+ - jumpTo
+ - changeSize
+ properties:
+ jumpTo:
+ allOf:
+ - $ref: './link.yml'
+ - description: |-
+ Templated link to another page offset.
+
+ **Resource**: Collection
+ changeSize:
+ allOf:
+ - $ref: './link.yml'
+ - description: |-
+ Templated link for another page size.
+
+ **Resource**: Collection
diff --git a/docs/api/apiv3/openapi-spec.yml b/docs/api/apiv3/openapi-spec.yml
index 3012ae5c16b..e867a23f461 100644
--- a/docs/api/apiv3/openapi-spec.yml
+++ b/docs/api/apiv3/openapi-spec.yml
@@ -463,6 +463,12 @@ components:
examples:
DateAlertNotification:
$ref: './components/examples/date_alert_notification.yml'
+ GridSimpleCollectionResponse:
+ "$ref": "./components/examples/grid-simple-collection-response.yml"
+ GridSimplePatchModel:
+ "$ref": "./components/examples/grid-simple-patch-model.yml"
+ GridSimpleResponse:
+ "$ref": "./components/examples/grid-simple-response.yml"
MentionedNotification:
$ref: './components/examples/mentioned_notification.yml'
NotificationCollection:
@@ -575,8 +581,14 @@ components:
$ref: './components/schemas/file_link_write_model.yml'
Formattable:
"$ref": "./components/schemas/formattable.yml"
- GridModel:
- "$ref": "./components/schemas/grid_model.yml"
+ GridCollectionModel:
+ "$ref": "./components/schemas/grid_collection_model.yml"
+ GridReadModel:
+ "$ref": "./components/schemas/grid_read_model.yml"
+ GridWidgetModel:
+ "$ref": "./components/schemas/grid_widget_model.yml"
+ GridWriteModel:
+ "$ref": "./components/schemas/grid_write_model.yml"
GroupCollectionModel:
"$ref": "./components/schemas/group_collection_model.yml"
GroupModel:
@@ -621,6 +633,8 @@ components:
"$ref": "./components/schemas/oauth_client_credentials_read_model.yml"
OAuthClientCredentialsWriteModel:
"$ref": "./components/schemas/oauth_client_credentials_write_model.yml"
+ PaginatedCollectionModel:
+ "$ref": "./components/schemas/paginated_collection_model.yml"
Plain_TextModel:
"$ref": "./components/schemas/plain_text_model.yml"
PostModel:
diff --git a/docs/api/apiv3/paths/grid.yml b/docs/api/apiv3/paths/grid.yml
index 5deb5d0990c..d29ae19cba5 100644
--- a/docs/api/apiv3/paths/grid.yml
+++ b/docs/api/apiv3/paths/grid.yml
@@ -1,80 +1,91 @@
# /api/v3/grids/{id}
---
get:
+ summary: Get a grid
+ operationId: get_grid
+ tags:
+ - Grids
+ description: Fetches a single grid identified by its id.
parameters:
- - description: Grid id
- example: '1'
- in: path
- name: id
- required: true
- schema:
- type: integer
+ - name: id
+ in: path
+ description: Grid id
+ required: true
+ schema:
+ type: integer
+ example: '42'
responses:
'200':
+ description: OK
content:
application/hal+json:
- examples:
- response:
- value:
- _links:
- scope:
- href: "/my/page"
- type: text/html
- self:
- href: "/api/v3/grids/2"
- update:
- href: "/api/v3/grids/2/form"
- method: post
- updateImmediately:
- href: "/api/v3/grids/2"
- method: patch
- _type: Grid
- columnCount: 5
- createdAt: '2018-12-03T16:58:30Z'
- id: 2
- rowCount: 8
- updatedAt: '2018-12-13T19:36:40Z'
- widgets:
- - _type: GridWidget
- endColumn: 3
- endRow: 8
- identifier: time_entries_current_user
- startColumn: 1
- startRow: 1
- - _type: GridWidget
- endColumn: 5
- endRow: 8
- identifier: news
- startColumn: 4
- startRow: 3
- - _type: GridWidget
- endColumn: 6
- endRow: 3
- identifier: documents
- startColumn: 3
- startRow: 1
schema:
- "$ref": "../components/schemas/grid_model.yml"
- description: OK
- headers: {}
+ $ref: '../components/schemas/grid_read_model.yml'
+ examples:
+ 'Simple grid':
+ $ref: '../components/examples/grid-simple-response.yml'
'404':
content:
application/hal+json:
schema:
$ref: "../components/schemas/error_response.yml"
- examples:
- response:
- value:
- _type: Error
- errorIdentifier: urn:openproject-org:api:v3:errors:NotFound
- message: The requested resource could not be found.
+ example:
+ _type: Error
+ errorIdentifier: urn:openproject-org:api:v3:errors:NotFound
+ message: The requested resource could not be found.
description: |-
Returned if the Grid does not exist or if the user does not have permission to view it.
**Required permission** depends on the page the grid is defined for
- headers: {}
+
+patch:
+ summary: Update a grid
+ operationId: update_grid
tags:
- - Grids
- description: ''
- operationId: View_grid
- summary: View grid
+ - Grids
+ description: |-
+ Updates the given grid by applying the attributes provided in the body. The constraints applied to the grid depend
+ on the page the grid is placed in which is why the create form end point should be used to be guided when wanting
+ to update a grid.
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '../components/schemas/grid_write_model.yml'
+ examples:
+ 'Simple grid patch':
+ $ref: '../components/examples/grid-simple-patch-model.yml'
+ responses:
+ '200':
+ description: OK
+ content:
+ application/hal+json:
+ schema:
+ $ref: '../components/schemas/grid_read_model.yml'
+ examples:
+ 'Simple grid':
+ $ref: '../components/examples/grid-simple-response.yml'
+ '400':
+ $ref: '../components/responses/invalid_request_body.yml'
+ '403':
+ content:
+ application/hal+json:
+ schema:
+ $ref: '../components/schemas/error_response.yml'
+ example:
+ _type: Error
+ errorIdentifier: urn:openproject-org:api:v3:errors:MissingPermission
+ message: You are not authorized to access this resource.
+ description: |-
+ Returned if the client does not have sufficient permissions.
+
+ **Required permission:** The permission depends on the page the grid is placed in.
+ '406':
+ $ref: '../components/responses/missing_content_type.yml'
+ '415':
+ $ref: '../components/responses/unsupported_media_type.yml'
+ '422':
+ description: |-
+ Returned if:
+
+ * a constraint for a property was violated (`PropertyConstraintViolation`)
diff --git a/docs/api/apiv3/paths/grids.yml b/docs/api/apiv3/paths/grids.yml
index 71237cf3793..ff248dc87f9 100644
--- a/docs/api/apiv3/paths/grids.yml
+++ b/docs/api/apiv3/paths/grids.yml
@@ -1,202 +1,118 @@
# /api/v3/grids
---
get:
+ summary: List grids
+ tags:
+ - Grids
+ description: |-
+ Lists all grids matching the provided filters and being part of the selected query page. The grids returned will
+ also depend on the permissions of the requesting user.
+ operationId: list_grids
parameters:
- - description: Page number inside the requested collection.
- example: '25'
- in: query
- name: offset
- required: false
- schema:
- default: 1
- type: integer
- - description: Number of elements to display per page.
- example: '25'
- in: query
- name: pageSize
- required: false
- schema:
- type: integer
- - description: |-
- JSON specifying filter conditions.
- Accepts the same format as returned by the [queries](https://www.openproject.org/docs/api/endpoints/queries/) endpoint. Currently supported filters are:
-
- + page: Filter grid by work package
- example: '[{ "page": { "operator": "=", "values": ["/my/page"] } }]'
- in: query
- name: filters
- required: false
- schema:
- type: string
+ - name: offset
+ schema:
+ type: integer
+ default: 1
+ description: Page number inside the requested collection.
+ in: query
+ required: false
+ example: '25'
+ - name: pageSize
+ schema:
+ type: integer
+ default: 30
+ description: Number of elements to display per page.
+ in: query
+ required: false
+ example: '25'
+ - name: filters
+ schema:
+ type: string
+ description: |-
+ JSON specifying filter conditions. Accepts the same format as returned by
+ the [queries](https://www.openproject.org/docs/api/endpoints/queries/) endpoint. Currently supported filters
+ are:
+
+ - page: Filter grid by work package
+ in: query
+ required: false
+ example: '[{ "page": { "operator": "=", "values": ["/my/page"] } }]'
responses:
'200':
- content:
- application/hal+json:
- examples:
- response:
- value:
- _links:
- scope:
- href: "/my/page"
- type: text/html
- self:
- href: "/api/v3/grids/2"
- update:
- href: "/api/v3/grids/2/form"
- method: post
- updateImmediately:
- href: "/api/v3/grids/2"
- method: patch
- _type: Grid
- columnCount: 5
- createdAt: '2018-12-03T16:58:30Z'
- id: 2
- rowCount: 8
- updatedAt: '2018-12-13T19:36:40Z'
- widgets:
- - _type: GridWidget
- endColumn: 3
- endRow: 8
- identifier: time_entries_current_user
- startColumn: 1
- startRow: 1
- - _type: GridWidget
- endColumn: 5
- endRow: 8
- identifier: news
- startColumn: 4
- startRow: 3
- - _type: GridWidget
- endColumn: 6
- endRow: 3
- identifier: documents
- startColumn: 3
- startRow: 1
- schema:
- "$ref": "../components/schemas/grid_model.yml"
description: OK
- headers: {}
- '400':
content:
application/hal+json:
schema:
- $ref: "../components/schemas/error_response.yml"
+ $ref: '../components/schemas/grid_collection_model.yml'
examples:
- response:
- value:
- _type: Error
- errorIdentifier: urn:openproject-org:api:v3:errors:InvalidQuery
- message:
- - Filters Invalid filter does not exist.
+ 'Simple grid':
+ $ref: '../components/examples/grid-simple-collection-response.yml'
+ '400':
description: Returned if the client sends invalid request parameters e.g. filters
- headers: {}
- '403':
content:
application/hal+json:
schema:
- $ref: "../components/schemas/error_response.yml"
- examples:
- response:
- value:
- _type: Error
- errorIdentifier: urn:openproject-org:api:v3:errors:MissingPermission
- message: You are not authorized to view this resource.
- description: Returned if the client is not logged in and login is required.
- headers: {}
- tags:
- - Grids
- description: Lists all grids matching the provided filters and being part of the
- selected query page. The grids returned will also depend on the permissions of
- the requesting user.
- operationId: List_Grids
- summary: List Grids
-patch:
- responses:
- '200':
- content:
- application/hal+json:
- schema:
- "$ref": "../components/schemas/grid_model.yml"
- description: OK
- headers: {}
- '400':
- $ref: "../components/responses/invalid_request_body.yml"
+ $ref: '../components/schemas/error_response.yml'
+ example:
+ _type: Error
+ errorIdentifier: urn:openproject-org:api:v3:errors:InvalidQuery
+ message: Filters Invalid filter does not exist.
'403':
+ description: Returned if the client is not logged in and login is required.
content:
application/hal+json:
schema:
- $ref: "../components/schemas/error_response.yml"
- examples:
- response:
- value:
- _type: Error
- errorIdentifier: urn:openproject-org:api:v3:errors:MissingPermission
- message: You are not authorized to access this resource.
- description: |-
- Returned if the client does not have sufficient permissions.
-
- **Required permission:** The permission depends on the page the grid is placed in.
- headers: {}
- '406':
- $ref: "../components/responses/missing_content_type.yml"
- '415':
- $ref: "../components/responses/unsupported_media_type.yml"
- '422':
- description: |-
- Returned if:
+ $ref: '../components/schemas/error_response.yml'
+ example:
+ _type: Error
+ errorIdentifier: urn:openproject-org:api:v3:errors:MissingPermission
+ message: You are not authorized to view this resource.
- * a constraint for a property was violated (`PropertyConstraintViolation`)
- headers: {}
- tags:
- - Grids
- description: Updates the given grid by applying the attributes provided in the body. The
- constraints applied to the grid depend on the page the grid is placed in which
- is why the create form end point should be used to be guided when wanting to update
- a grid.
- operationId: Update_Grid
- summary: Update Grid
post:
+ summary: Create a grid
+ operationId: create_grid
+ tags:
+ - Grids
+ description: |-
+ Creates a new grid applying the attributes provided in the body. The constraints applied to the grid depend on the
+ page the grid is placed in which is why the create form end point should be used to be guided when wanting to
+ create a grid.
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '../components/schemas/grid_write_model.yml'
+ examples:
+ 'Simple grid creation':
+ $ref: '../components/examples/grid-simple-patch-model.yml'
responses:
'201':
+ description: Created
content:
application/hal+json:
schema:
- "$ref": "../components/schemas/grid_model.yml"
- description: Created
- headers: {}
+ $ref: '../components/schemas/grid_read_model.yml'
'400':
- $ref: "../components/responses/invalid_request_body.yml"
+ $ref: '../components/responses/invalid_request_body.yml'
'403':
content:
application/hal+json:
schema:
- $ref: "../components/schemas/error_response.yml"
- examples:
- response:
- value:
- _type: Error
- errorIdentifier: urn:openproject-org:api:v3:errors:MissingPermission
- message: You are not authorized to access this resource.
+ $ref: '../components/schemas/error_response.yml'
+ example:
+ _type: Error
+ errorIdentifier: urn:openproject-org:api:v3:errors:MissingPermission
+ message: You are not authorized to access this resource.
description: |-
Returned if the client does not have sufficient permissions.
**Required permission:** Depends on the page the grid is defined for.
- headers: {}
'406':
- $ref: "../components/responses/missing_content_type.yml"
+ $ref: '../components/responses/missing_content_type.yml'
'415':
- $ref: "../components/responses/unsupported_media_type.yml"
+ $ref: '../components/responses/unsupported_media_type.yml'
'422':
description: |-
Returned if:
* a constraint for a property was violated (`PropertyConstraintViolation`)
- headers: {}
- tags:
- - Grids
- description: Creates a new grid applying the attributes provided in the body. The
- constraints applied to the grid depend on the page the grid is placed in which
- is why the create form end point should be used to be guided when wanting to create
- a grid.
- operationId: Create_Grid
- summary: Create Grid