Skip to content

Commit

Permalink
Add User Group Instances endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
jellejurre committed Nov 11, 2024
1 parent 2c9ebeb commit 5e84213
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
2 changes: 2 additions & 0 deletions openapi/components/paths.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@
$ref: "./paths/users.yaml#/paths/~1users~1{userId}~1groups~1requested"
"/users/{userId}/groups/represented":
$ref: "./paths/users.yaml#/paths/~1users~1{userId}~1groups~1represented"
"/users/{userId}/instances/groups":
$ref: "./paths/users.yaml#/paths/~1users~1{userId}~1instances~1groups"

# worlds

Expand Down
18 changes: 18 additions & 0 deletions openapi/components/paths/users.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,24 @@ paths:
$ref: ../responses/MissingCredentialsError.yaml
security:
- authCookie: []
"/users/{userId}/instances/groups":
parameters:
- $ref: ../parameters.yaml#/userId
get:
summary: Get User Group Instances
description: Returns a list of group instances for a user
operationId: getUserGroupInstances
tags:
- users
responses:
'200':
$ref: ../responses/users/UserGroupInstanceListResponse.yaml
'401':
$ref: ../responses/MissingCredentialsError.yaml
'403':
$ref: ../responses/users/UserMustBeOwnError.yaml
security:
- authCookie: []
tags:
$ref: ../tags.yaml
components:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
description: Returns a list of Instance objects with a fetched at time.
content:
application/json:
schema:
type: object
properties:
fetchedAt:
type: string
format: date-time
instances:
type: array
items:
$ref: ../../schemas/Instance.yaml
11 changes: 11 additions & 0 deletions openapi/components/responses/users/UserMustBeOwnError.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description: Error response when trying get group instances of another user.
content:
application/json:
schema:
$ref: ../../schemas/Error.yaml
examples:
User Id must be your own:
value:
error:
message: "User ID must be your own․"
status_code: 403

0 comments on commit 5e84213

Please sign in to comment.