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] Refactored api group model (#13042)

Eric Schubert46b9e18994ed
diff --git a/docs/api/apiv3/components/schemas/group_collection_model.yml b/docs/api/apiv3/components/schemas/group_collection_model.yml
new file mode 100644
index 00000000000..04a09ea7c18
--- /dev/null
+++ b/docs/api/apiv3/components/schemas/group_collection_model.yml
@@ -0,0 +1,65 @@
+# Schema: GroupCollectionModel
+---
+allOf:
+ - $ref: './collection_model.yml'
+ - type: object
+ required:
+ - _links
+ - _embedded
+ properties:
+ _links:
+ type: object
+ required:
+ - self
+ properties:
+ self:
+ allOf:
+ - $ref: "./link.yml"
+ - description: |-
+ This group collection
+
+ **Resource**: GroupCollectionReadModel
+ _embedded:
+ type: object
+ required:
+ - elements
+ properties:
+ elements:
+ type: array
+ items:
+ $ref: './group_model.yml'
+
+example:
+ _type: Collection
+ total: 2
+ count: 2
+ _links:
+ self:
+ href: '/api/v3/groups'
+ _embedded:
+ elements:
+ - _type: Group
+ id: 1337
+ name: Stormtroopers
+ createdAt: '2022-09-23T11:06:36Z'
+ updatedAt: '2022-09-23T11:06:36Z'
+ _links:
+ self:
+ href: '/api/v3/groups/9'
+ title: Stormtroopers
+ delete:
+ href: '/api/v3/group/9'
+ method: delete
+ memberships:
+ href: '/api/v3/memberships?filters=[{"principal":{"operator":"=","values":["9"]}}]'
+ title: Memberships
+ updateImmediately:
+ href: '/api/v3/group/9'
+ method: patch
+ members:
+ - href: '/api/v3/users/363'
+ title: ST-097E
+ - href: '/api/v3/users/60'
+ title: ST-C-334
+ - _hint: Group resource shortened for brevity
+ id: 1338
diff --git a/docs/api/apiv3/components/schemas/group_model.yml b/docs/api/apiv3/components/schemas/group_model.yml
new file mode 100644
index 00000000000..b9737b4617e
--- /dev/null
+++ b/docs/api/apiv3/components/schemas/group_model.yml
@@ -0,0 +1,107 @@
+# Schema: GroupModel
+---
+type: object
+required:
+ - _type
+ - id
+ - _links
+properties:
+ id:
+ type: integer
+ description: The group id
+ minimum: 1
+ name:
+ type: string
+ description: |-
+ Group's full name, formatting depends on instance settings
+
+ # Conditions
+ - admin
+ createdAt:
+ type: string
+ format: date-time
+ description: |-
+ Time of creation
+
+ # Conditions
+ - admin
+ updatedAt:
+ type: string
+ format: date-time
+ description: Time of the most recent change to the user
+ _links:
+ type: object
+ required:
+ - self
+ properties:
+ self:
+ allOf:
+ - $ref: './link.yml'
+ - description: |-
+ This group resource
+
+ **Resource**: Group
+ delete:
+ allOf:
+ - $ref: './link.yml'
+ - description: |-
+ Deletes the group.
+
+ # Conditions
+ **Permission**: Administrator
+ updateImmediately:
+ allOf:
+ - $ref: './link.yml'
+ - description: |-
+ Updates the group's attributes.
+
+ # Conditions
+ **Permission**: Administrator
+ memberships:
+ allOf:
+ - $ref: './link.yml'
+ - description: |-
+ Link to collection of all the group's memberships. The list will only include the memberships in projects
+ in which the requesting user has the necessary permissions.
+
+ **Resource**: MemberCollection
+
+ # Conditions
+ **Permission**: `view members` or `manage members` in any project
+ members:
+ type: array
+ items:
+ allOf:
+ - $ref: './link.yml'
+ - description: |-
+ One of the members of the group.
+
+ **Resource**: User
+
+ # Conditions
+ **Permission**: `manage members` in any project to read & admin to write
+
+example:
+ _type: Group
+ id: 9
+ name: Stormtroopers
+ createdAt: '2022-09-23T11:06:36Z'
+ updatedAt: '2022-09-23T11:06:36Z'
+ _links:
+ self:
+ href: '/api/v3/groups/9'
+ title: Stormtroopers
+ delete:
+ href: '/api/v3/group/9'
+ method: delete
+ memberships:
+ href: '/api/v3/memberships?filters=[{"principal":{"operator":"=","values":["9"]}}]'
+ title: Memberships
+ updateImmediately:
+ href: '/api/v3/group/9'
+ method: patch
+ members:
+ - href: '/api/v3/users/363'
+ title: ST-097E
+ - href: '/api/v3/users/60'
+ title: ST-C-334
diff --git a/docs/api/apiv3/components/schemas/group_write_model.yml b/docs/api/apiv3/components/schemas/group_write_model.yml
new file mode 100644
index 00000000000..3ad3ef773b9
--- /dev/null
+++ b/docs/api/apiv3/components/schemas/group_write_model.yml
@@ -0,0 +1,27 @@
+# Schema: GroupWriteModel
+---
+type: object
+properties:
+ name:
+ type: string
+ description: The new group name.
+ _links:
+ type: object
+ properties:
+ members:
+ type: array
+ items:
+ allOf:
+ - $ref: './link.yml'
+ - description: |-
+ A new member for the group.
+
+ **Resource**: User
+
+example:
+ name: Emperor's guard
+ _links:
+ members:
+ - href: '/api/v3/users/42'
+ - href: '/api/v3/users/43'
+ - href: '/api/v3/users/44'
diff --git a/docs/api/apiv3/components/schemas/list_groups_model.yml b/docs/api/apiv3/components/schemas/list_groups_model.yml
deleted file mode 100644
index 2b4f2b50f99..00000000000
--- a/docs/api/apiv3/components/schemas/list_groups_model.yml
+++ /dev/null
@@ -1,46 +0,0 @@
-# Schema: List_groupsModel
----
-type: object
-example:
- _links:
- self:
- href: "/api/v3/groups"
- total: 2
- count: 2
- _type: Collection
- _embedded:
- elements:
- - _type: Group
- id: 9
- name: The group
- createdAt: '2015-09-23T11:06:36Z'
- updatedAt: '2015-09-23T11:06:36Z'
- _links:
- self:
- href: "/api/v3/groups/9"
- title: The group
- memberships:
- href: /api/v3/memberships?filters=[{"principal":{"operator":"=","values":["9"]}}]
- title: Memberships
- members:
- - href: "/api/v3/users/363"
- title: First user
- - href: "/api/v3/users/60"
- title: Second user
- - _type: Group
- id: 123
- name: Another group
- createdAt: '2018-09-23T11:06:36Z'
- updatedAt: '2019-09-23T11:06:36Z'
- _links:
- self:
- href: "/api/v3/groups/123"
- title: Another group
- memberships:
- href: /api/v3/memberships?filters=[{"principal":{"operator":"=","values":["123"]}}]
- title: Memberships
- members:
- - href: "/api/v3/users/343"
- title: Third user
- - href: "/api/v3/users/60"
- title: Second user
diff --git a/docs/api/apiv3/components/schemas/view_group_model.yml b/docs/api/apiv3/components/schemas/view_group_model.yml
deleted file mode 100644
index 2ef051c2049..00000000000
--- a/docs/api/apiv3/components/schemas/view_group_model.yml
+++ /dev/null
@@ -1,27 +0,0 @@
-# Schema: View_groupModel
----
-type: object
-example:
- _type: Group
- id: 9
- name: The group
- createdAt: '2015-09-23T11:06:36Z'
- updatedAt: '2015-09-23T11:06:36Z'
- _links:
- self:
- href: "/api/v3/groups/9"
- title: The group
- delete:
- href: "/api/v3/group/9"
- method: delete
- memberships:
- href: /api/v3/memberships?filters=[{"principal":{"operator":"=","values":["9"]}}]
- title: Memberships
- updateImmediately:
- href: "/api/v3/group/9"
- method: patch
- members:
- - href: "/api/v3/users/363"
- title: First user
- - href: "/api/v3/users/60"
- title: Second user
diff --git a/docs/api/apiv3/openapi-spec.yml b/docs/api/apiv3/openapi-spec.yml
index 9390b5ab972..abc960b1314 100644
--- a/docs/api/apiv3/openapi-spec.yml
+++ b/docs/api/apiv3/openapi-spec.yml
@@ -577,6 +577,12 @@ components:
"$ref": "./components/schemas/formattable.yml"
GridModel:
"$ref": "./components/schemas/grid_model.yml"
+ GroupCollectionModel:
+ "$ref": "./components/schemas/group_collection_model.yml"
+ GroupModel:
+ "$ref": "./components/schemas/group_model.yml"
+ GroupWriteModel:
+ "$ref": "./components/schemas/group_write_model.yml"
Help_textModel:
"$ref": "./components/schemas/help_text_model.yml"
Help_textsModel:
@@ -589,8 +595,6 @@ components:
"$ref": "./components/schemas/list_available_parent_project_candidates_model.yml"
List_capabilitiesModel:
"$ref": "./components/schemas/list_capabilities_model.yml"
- List_groupsModel:
- "$ref": "./components/schemas/list_groups_model.yml"
List_membershipsModel:
"$ref": "./components/schemas/list_memberships_model.yml"
List_of_NewsModel:
@@ -737,8 +741,6 @@ components:
"$ref": "./components/schemas/view_capabilities_model.yml"
View_global_contextModel:
"$ref": "./components/schemas/view_global_context_model.yml"
- View_groupModel:
- "$ref": "./components/schemas/view_group_model.yml"
View_membershipModel:
"$ref": "./components/schemas/view_membership_model.yml"
View_membership_schemaModel:
diff --git a/docs/api/apiv3/paths/group.yml b/docs/api/apiv3/paths/group.yml
index e56e36dd34d..dae8e3c6988 100644
--- a/docs/api/apiv3/paths/group.yml
+++ b/docs/api/apiv3/paths/group.yml
@@ -1,14 +1,19 @@
# /api/v3/groups/{id}
---
delete:
+ summary: Delete group
+ operationId: delete_group
+ tags:
+ - Groups
+ description: Deletes the group.
parameters:
- - description: Group id
- example: '1'
- in: path
- name: id
- required: true
- schema:
- type: integer
+ - name: id
+ description: Group id
+ example: 1
+ in: path
+ required: true
+ schema:
+ type: integer
responses:
'202':
description: |-
@@ -16,34 +21,20 @@ delete:
Note that the response body is empty as of now. In future versions of the API a body
*might* be returned, indicating the progress of deletion.
- 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 access this resource.
description: |-
Returned if the client does not have sufficient permissions.
**Required permission:** Administrator
- headers: {}
- '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.
+ $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.
+ '404':
description: |-
Returned if the group does not exist or the client does not have sufficient permissions
to see it.
@@ -52,153 +43,104 @@ delete:
*Note: A client without sufficient permissions shall not be able to test for the existence of
a version. That's why a 404 is returned here, even if a 403 might be more appropriate.*
- headers: {}
+ 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.
'406':
- $ref: "../components/responses/missing_content_type.yml"
+ $ref: '../components/responses/missing_content_type.yml'
'415':
- $ref: "../components/responses/unsupported_media_type.yml"
- tags:
- - Groups
- description: Deletes the group.
- operationId: Delete_group
- summary: Delete group
+ $ref: '../components/responses/unsupported_media_type.yml'
+
get:
+ summary: Get group
+ operationId: get_group
+ tags:
+ - Groups
+ description: Fetches a group resource.
parameters:
- - description: Group id
- example: '1'
- in: path
- name: id
- required: true
- schema:
- type: integer
+ - name: id
+ description: Group id
+ example: 1
+ in: path
+ required: true
+ schema:
+ type: integer
responses:
'200':
- content:
- application/hal+json:
- examples:
- response:
- value:
- _links:
- delete:
- href: "/api/v3/group/9"
- method: delete
- members:
- - href: "/api/v3/users/363"
- title: First user
- - href: "/api/v3/users/60"
- title: Second user
- memberships:
- href: /api/v3/memberships?filters=[{"principal":{"operator":"=","values":["9"]}}]
- title: Memberships
- self:
- href: "/api/v3/groups/9"
- title: The group
- updateImmediately:
- href: "/api/v3/group/9"
- method: patch
- _type: Group
- createdAt: '2015-09-23T11:06:36Z'
- id: 9
- name: The group
- updatedAt: '2015-09-23T11:06:36Z'
- schema:
- "$ref": "../components/schemas/view_group_model.yml"
description: OK
- headers: {}
- '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.
+ $ref: '../components/schemas/group_model.yml'
+ '404':
description: |-
Returned if the group does not exist or if the API user does not have permission to view them.
**Required permission** If the user has the *manage members* permission in at least one project the user will be able to query all groups. If not, the user
will be able to query all groups which are members in projects, he has the *view members* permission in.
- headers: {}
- tags:
- - Groups
- description: ''
- operationId: View_group
- summary: View group
+ 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.
+
patch:
+ summary: Update group
+ operationId: update_group
+ tags:
+ - Groups
+ description: |-
+ Updates the given group by applying the attributes provided in the body.
+
+ Please note that the `members` array provided will override the existing set of members (similar to a PUT). A
+ client thus has to provide the complete list of members the group is to have after the PATCH even if only one
+ member is to be added.
parameters:
- - description: Group id
- example: '1'
- in: path
- name: id
- required: true
- schema:
- type: integer
+ - name: id
+ description: Group id
+ example: 1
+ in: path
+ required: true
+ schema:
+ type: integer
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '../components/schemas/group_write_model.yml'
responses:
'200':
+ description: OK
content:
application/hal+json:
- examples:
- response:
- value:
- _links:
- delete:
- href: "/api/v3/group/9"
- method: delete
- members:
- - href: "/api/v3/users/363"
- title: First user
- - href: "/api/v3/users/60"
- title: Second user
- memberships:
- href: /api/v3/memberships?filters=[{"principal":{"operator":"=","values":["9"]}}]
- title: Memberships
- self:
- href: "/api/v3/groups/9"
- title: The group
- updateImmediately:
- href: "/api/v3/group/9"
- method: patch
- _type: Group
- createdAt: '2015-09-23T11:06:36Z'
- id: 9
- name: The group
- updatedAt: '2015-09-23T11:06:36Z'
schema:
- "$ref": "../components/schemas/view_group_model.yml"
- description: OK
- headers: {}
+ $ref: '../components/schemas/group_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.
description: |-
Returned if the client does not have sufficient permissions.
**Required permission:** Administrator
- headers: {}
- '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.
+ $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.
+ '404':
description: |-
Returned if the group does not exist or the client does not have sufficient permissions
to see it.
@@ -208,61 +150,31 @@ patch:
*Note: A client without sufficient permissions shall not be able to test for the existence of
a version. That's why a 404 is returned here, even if a 403 might be more appropriate.*
- headers: {}
- '406':
- $ref: "../components/responses/missing_content_type.yml"
- '415':
- $ref: "../components/responses/unsupported_media_type.yml"
- '422':
content:
application/hal+json:
schema:
- $ref: "../components/schemas/error_response.yml"
- examples:
- response:
- value:
- _embedded:
- details:
- attribute: members
- _type: Error
- errorIdentifier: urn:openproject-org:api:v3:errors:PropertyConstraintViolation
- message: Member is already taken.
+ $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.
+ '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`)
- headers: {}
- tags:
- - Groups
- description: |-
- Updates the given group by applying the attributes provided in the
- body.
-
- Please note that the `members` array provided will override the existing set of members (similar to a PUT). A client thus
- has to provide the complete list of members the group is to have after the PATCH even if only one member is to be added.
- operationId: Update_group
- requestBody:
- content:
- application/json:
- schema:
+ content:
+ application/hal+json:
+ schema:
+ $ref: '../components/schemas/error_response.yml'
example:
- _links:
- members:
- - href: "/api/v3/users/363"
- - href: "/api/v3/users/60"
- name: The group
- properties:
- _links:
- properties:
- members:
- type: array
- items:
- type: object
- properties:
- href:
- type: string
- type: object
- name:
- type: string
- type: object
- summary: Update group
+ _embedded:
+ details:
+ attribute: members
+ _type: Error
+ errorIdentifier: urn:openproject-org:api:v3:errors:PropertyConstraintViolation
+ message: Member is already taken.
diff --git a/docs/api/apiv3/paths/groups.yml b/docs/api/apiv3/paths/groups.yml
index ead44144115..bd281828881 100644
--- a/docs/api/apiv3/paths/groups.yml
+++ b/docs/api/apiv3/paths/groups.yml
@@ -1,184 +1,111 @@
# /api/v3/groups
---
get:
+ summary: List groups
+ operationId: list_groups
+ tags:
+ - Groups
+ description: |-
+ Returns a collection of groups. The client can choose to filter the
+ groups similar to how work packages are filtered. In addition to the provided
+ filters, the server will reduce the result set to only contain groups, for which
+ the requesting client has sufficient permissions (*view_members*, *manage_members*).
parameters:
- - description: |-
- JSON specifying sort criteria.
- Accepts the same format as returned by the [queries](https://www.openproject.org/docs/api/endpoints/queries/) endpoint. Currently supported sorts are:
-
- + id: Sort by primary key
-
- + created_at: Sort by group creation datetime
-
- + updated_at: Sort by the time the group was updated last
- example: '[["id", "asc"]]'
- in: query
- name: sortBy
- required: false
- schema:
- default: '[["id", "asc"]]'
- type: string
- - description: |-
- Comma separated list of properties to include.
- example: 'total,elements/name,elements/self,self'
- in: query
- name: select
- required: false
- schema:
- type: string
+ - name: sortBy
+ description: |-
+ JSON specifying sort criteria.
+ Accepts the same format as returned by the [queries](https://www.openproject.org/docs/api/endpoints/queries/) endpoint. Currently supported sorts are:
+
+ + id: Sort by primary key
+
+ + created_at: Sort by group creation datetime
+
+ + updated_at: Sort by the time the group was updated last
+ in: query
+ required: false
+ example: '[["id", "asc"]]'
+ schema:
+ default: '[["id", "asc"]]'
+ type: string
+ - name: select
+ description: |-
+ Comma separated list of properties to include.
+ in: query
+ required: false
+ example: 'total,elements/name,elements/self,self'
+ schema:
+ type: string
responses:
'200':
- content:
- application/hal+json:
- examples:
- response:
- value:
- _embedded:
- elements:
- - _links:
- members:
- - href: "/api/v3/users/363"
- title: First user
- - href: "/api/v3/users/60"
- title: Second user
- memberships:
- href: /api/v3/memberships?filters=[{"principal":{"operator":"=","values":["9"]}}]
- title: Memberships
- self:
- href: "/api/v3/groups/9"
- title: The group
- _type: Group
- createdAt: '2015-09-23T11:06:36Z'
- id: 9
- name: The group
- updatedAt: '2015-09-23T11:06:36Z'
- - _links:
- members:
- - href: "/api/v3/users/343"
- title: Third user
- - href: "/api/v3/users/60"
- title: Second user
- memberships:
- href: /api/v3/memberships?filters=[{"principal":{"operator":"=","values":["123"]}}]
- title: Memberships
- self:
- href: "/api/v3/groups/123"
- title: Another group
- _type: Group
- createdAt: '2018-09-23T11:06:36Z'
- id: 123
- name: Another group
- updatedAt: '2019-09-23T11:06:36Z'
- _links:
- self:
- href: "/api/v3/groups"
- _type: Collection
- count: 2
- total: 2
- schema:
- "$ref": "../components/schemas/list_groups_model.yml"
description: OK
- 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 access this resource.
+ $ref: '../components/schemas/group_collection_model.yml'
+ '403':
description: |-
Returned if the client does not have sufficient permissions.
**Required permission:** View members or manage members in any project
- headers: {}
- tags:
- - Groups
- description: Returns a collection of groups. The client can choose to filter the
- groups similar to how work packages are filtered. In addition to the provided
- filters, the server will reduce the result set to only contain groups, for which
- the requesting client has sufficient permissions (*view_members*, *manage_members*).
- operationId: List_groups
- summary: List groups
+ 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.
+
post:
+ summary: Create group
+ operationId: create_group
+ tags:
+ - Groups
+ description: Creates a new group applying the attributes provided in the body.
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '../components/schemas/group_write_model.yml'
responses:
'201':
+ description: Created
content:
application/hal+json:
schema:
- "$ref": "../components/schemas/view_group_model.yml"
- description: Created
- headers: {}
+ $ref: '../components/schemas/group_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.
description: |-
Returned if the client does not have sufficient permissions.
**Required permission:** Administrator
- headers: {}
- '406':
- $ref: "../components/responses/missing_content_type.yml"
- '415':
- $ref: "../components/responses/unsupported_media_type.yml"
- '422':
content:
application/hal+json:
schema:
- $ref: "../components/schemas/error_response.yml"
- examples:
- response:
- value:
- _embedded:
- details:
- attribute: name
- _type: Error
- errorIdentifier: urn:openproject-org:api:v3:errors:PropertyConstraintViolation
- message: Name can't be blank.
+ $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.
+ '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`)
- headers: {}
- tags:
- - Groups
- description: Creates a new group applying the attributes provided in the body.
- operationId: Create_group
- requestBody:
- content:
- application/json:
- schema:
+ content:
+ application/hal+json:
+ schema:
+ $ref: '../components/schemas/error_response.yml'
example:
- _links:
- members:
- - href: "/api/v3/users/363"
- - href: "/api/v3/users/60"
- name: The group
- properties:
- _links:
- properties:
- members:
- type: array
- items:
- type: object
- properties:
- href:
- type: string
- type: object
- name:
- type: string
- type: object
- summary: Create group
+ _embedded:
+ details:
+ attribute: name
+ _type: Error
+ errorIdentifier: urn:openproject-org:api:v3:errors:PropertyConstraintViolation
+ message: Name can't be blank.