Skip to content

Commit 888ac05

Browse files
committed
fix(openapi): remove /delete route; add POST action=delete tombstone for org team
1 parent c52ef5c commit 888ac05

File tree

1 file changed

+32
-15
lines changed
  • schemas/constructs/v1beta1/organization

1 file changed

+32
-15
lines changed

schemas/constructs/v1beta1/organization/api.yml

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,28 @@ paths:
2929
description: Internal server error
3030

3131
/api/identity/orgs/{orgID}/teams/{teamId}:
32-
delete:
33-
summary: Remove team from organization
34-
description: Removes (unassigns) a team from an organization.
35-
operationId: RemoveTeamFromOrg
32+
post:
33+
summary: Add team to organization or soft delete team
34+
description: Adds a team to an organization. If request body contains action=delete, tombstones a team by setting its deleted_at timestamp. The team's organization mapping remains intact.
35+
operationId: AddTeamToOrg
3636
parameters:
3737
- $ref: "#/components/parameters/orgID"
3838
- $ref: "#/components/parameters/teamId"
39+
requestBody:
40+
required: false
41+
content:
42+
application/json:
43+
schema:
44+
$ref: "#/components/schemas/OrgTeamActionPayload"
3945
responses:
4046
"200":
41-
description: Team removed from organization
47+
description: Team added to organization or team tombstoned
4248
content:
4349
application/json:
4450
schema:
45-
$ref: "#/components/schemas/TeamsOrganizationsMappingPage"
51+
oneOf:
52+
- $ref: "#/components/schemas/TeamsOrganizationsMappingPage"
53+
- $ref: "#/components/schemas/TeamsPage"
4654
"400":
4755
description: Bad request
4856
"401":
@@ -52,21 +60,20 @@ paths:
5260
"500":
5361
description: Internal server error
5462

55-
/api/identity/orgs/{orgID}/teams/{teamId}/delete:
56-
post:
57-
summary: Soft delete team
58-
description: Tombstones a team by setting its deleted_at timestamp. The team's organization mapping remains intact.
59-
operationId: DeleteTeam
63+
delete:
64+
summary: Remove team from organization
65+
description: Removes (unassigns) a team from an organization.
66+
operationId: RemoveTeamFromOrg
6067
parameters:
6168
- $ref: "#/components/parameters/orgID"
6269
- $ref: "#/components/parameters/teamId"
6370
responses:
6471
"200":
65-
description: Team tombstoned
72+
description: Team removed from organization
6673
content:
6774
application/json:
6875
schema:
69-
$ref: "#/components/schemas/TeamsPage"
76+
$ref: "#/components/schemas/TeamsOrganizationsMappingPage"
7077
"400":
7178
description: Bad request
7279
"401":
@@ -108,6 +115,16 @@ components:
108115
MapObject:
109116
$ref: "../../v1alpha1/core/api.yml#/components/schemas/MapObject"
110117

118+
OrgTeamActionPayload:
119+
type: object
120+
description: Optional action payload for POST on /api/identity/orgs/{orgID}/teams/{teamId}.
121+
properties:
122+
action:
123+
type: string
124+
description: Internal action to perform on the team resource.
125+
enum:
126+
- delete
127+
111128
Location:
112129
type: object
113130
required:
@@ -260,7 +277,7 @@ components:
260277
updated_at:
261278
$ref: "#/components/schemas/Time"
262279
deleted_at:
263-
$ref: "#/components/schemas/Time"
280+
$ref: "#/components/schemas/NullableTime"
264281

265282
TeamsPage:
266283
type: object
@@ -290,7 +307,7 @@ components:
290307
updated_at:
291308
$ref: "#/components/schemas/Time"
292309
deleted_at:
293-
$ref: "#/components/schemas/Time"
310+
$ref: "#/components/schemas/NullableTime"
294311

295312
TeamsOrganizationsMappingPage:
296313
type: object

0 commit comments

Comments
 (0)