Skip to content

Commit

Permalink
feat: add 'users/{userId}/groups/represented' (#262)
Browse files Browse the repository at this point in the history
* feat: add 'users/{userId}/groups/represented'

I believe I added everything needed, however this is my first time doing things with the OpenAPI spec.

This endpoint can return either an empty object or an object containing some info about the group that's being represented

* Update users.yaml

Im hoping this resolves that issue, if not i'll rework this some more ^^
  • Loading branch information
KaydaFox authored Feb 24, 2024
1 parent 12bd1b6 commit 05f6f19
Show file tree
Hide file tree
Showing 3 changed files with 57 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 @@ -231,6 +231,8 @@
$ref: "./paths/users.yaml#/paths/~1users~1{userId}~1groups"
"/users/{userId}/groups/requested":
$ref: "./paths/users.yaml#/paths/~1users~1{userId}~1groups~1requested"
"/users/{userId}/groups/represented":
$ref: "./paths/users.yaml#/paths/~1users~1{userId}~1groups~1represented"

# worlds

Expand Down
20 changes: 20 additions & 0 deletions openapi/components/paths/users.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,26 @@ paths:
$ref: ../responses/MissingCredentialsError.yaml
security:
- authCookie: []
"/users/{userId}/groups/represented":
parameters:
- $ref: ../parameters.yaml#/userId
get:
summary: Get user's current represented group
description: Returns the current group that the user is currently representing
operationId: getUserRepresentedGroup
tags:
- users
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: ../schemas/representedGroup.yaml
"401":
$ref: ../responses/MissingCredentialsError.yaml
security:
- authCookie: []
tags:
$ref: ../tags.yaml
components:
Expand Down
35 changes: 35 additions & 0 deletions openapi/components/schemas/representedGroup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
title: RepresentedGroup
type: object
properties:
name:
type: string
shortCode:
$ref: ./GroupShortCode.yaml
discriminator:
$ref: ./GroupDiscriminator.yaml
description:
type: string
iconId:
type: string
nullable: true
iconUrl:
type: string
nullable: true
bannerId:
type: string
nullable: true
bannerUrl:
type: string
nullable: true
privacy:
$ref: ./GroupPrivacy.yaml
ownerId:
$ref: ./UserID.yaml
memberCount:
type: integer
groupId:
$ref: ./GroupID.yaml
memberVisibility:
$ref: ./GroupUserVisibility.yaml
isRepresenting:
type: boolean

0 comments on commit 05f6f19

Please sign in to comment.