Skip to content

Commit 27427be

Browse files
luizhf42gustavosbarreto
authored andcommitted
fix(openapi): add missing fields to admin user endpoints
Add status field to UserAdminResponse and admin field to the GET /admin/api/users/{id} response. Both fields are returned by the Go backend but were missing from the OpenAPI spec, forcing the React UI to use type workarounds. Also adds email_marketing to both schemas and fixes the status enum from [confirmed, pending] to [confirmed, not-confirmed] to match the actual UserStatus constants in the backend. Fixes: #6088
1 parent ee2d6a1 commit 27427be

3 files changed

Lines changed: 24 additions & 10 deletions

File tree

openapi/spec/components/schemas/userAdminResponse.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,19 @@ properties:
66
description: User's integer of owned namespaces.
77
type: integer
88
minimum: 0
9-
confirmed:
10-
description: User's confirmation.
11-
type: boolean
9+
status:
10+
description: User's account status.
11+
type: string
12+
enum: [confirmed, not-confirmed]
1213
admin:
1314
description: User's admin status.
1415
type: boolean
16+
max_namespaces:
17+
description: Maximum number of namespaces the user can own.
18+
type: integer
19+
email_marketing:
20+
description: Whether the user has opted in to marketing emails.
21+
type: boolean
1522
created_at:
1623
description: User's creating date.
1724
type: string
@@ -33,6 +40,7 @@ properties:
3340
maxLength: 64
3441
required:
3542
- id
43+
- status
3644
- admin
3745
- created_at
3846
- last_login

openapi/spec/paths/admin@api@users.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ get:
6262
value:
6363
- id: 507f1f77bcf86cd799439011
6464
namespaces: 0
65-
confirmed: false
65+
status: not-confirmed
6666
admin: false
6767
created_at: 2020-05-01T00:00:00.000Z
6868
last_login: 2020-05-01T00:00:00.000Z
@@ -74,7 +74,7 @@ get:
7474
value:
7575
- id: 507f1f77bcf86cd799439011
7676
namespaces: 0
77-
confirmed: true
77+
status: confirmed
7878
admin: false
7979
created_at: 2020-05-01T00:00:00.000Z
8080
last_login: 2020-05-01T00:00:00.000Z
@@ -84,7 +84,7 @@ get:
8484
password: 50d858e0985ecc7f60418aaf0cc5ab587f42c2570a884095a9e8ccacd0f6545c
8585
- id: 507f191e810c19729de860ea
8686
namespaces: 2
87-
confirmed: false
87+
status: not-confirmed
8888
admin: true
8989
created_at: 2012-01-02T00:00:00.000Z
9090
last_login: 2012-01-02T00:00:00.000Z

openapi/spec/paths/admin@api@users@{id}.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,12 @@ get:
9090
id:
9191
$ref: ../components/schemas/userID.yaml
9292
status:
93-
description: User's status
93+
description: User's account status
9494
type: string
95-
enum: [confirmed, pending]
95+
enum: [confirmed, not-confirmed]
96+
admin:
97+
description: Whether the user has admin privileges
98+
type: boolean
9699
max_namespaces:
97100
description: Maximum number of namespaces the user can own
98101
type: integer
@@ -143,6 +146,7 @@ get:
143146
required:
144147
- id
145148
- status
149+
- admin
146150
- max_namespaces
147151
- created_at
148152
- last_login
@@ -157,6 +161,7 @@ get:
157161
value:
158162
id: '68ada99d2f96ee43fd86306a'
159163
status: 'confirmed'
164+
admin: true
160165
max_namespaces: 0
161166
created_at: '2025-08-26T12:33:33.19Z'
162167
last_login: '2025-10-27T13:10:59.458Z'
@@ -170,10 +175,11 @@ get:
170175
preferences:
171176
auth_methods:
172177
- 'local'
173-
user_pending:
178+
user_not_confirmed:
174179
value:
175180
id: '507f1f77bcf86cd799439012'
176-
status: 'pending'
181+
status: 'not-confirmed'
182+
admin: false
177183
max_namespaces: 5
178184
created_at: '2025-01-15T10:00:00.000Z'
179185
last_login: '2025-01-20T15:30:00.000Z'

0 commit comments

Comments
 (0)