-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rfc): unity swagger.yml Users and Invites draft (#293)
* feat(unity): add GET users to swagger def * feat(unity-swagger): add DELETE users * feat(unity-swagger): add POST invites * feat(unity-swagger): add DELETE invite * feat(unity-swagger): add resend invite
- Loading branch information
Showing
3 changed files
with
283 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,4 @@ cypress.env.json | |
junit.xml | ||
npm-error.log | ||
src/client/generatedRoutes.ts | ||
src/client/unityRoutes.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,280 @@ | ||
openapi: "3.0.0" | ||
info: | ||
title: Unity API Service | ||
version: 0.1.0 | ||
servers: | ||
- url: /unity/v2 # to be determined | ||
paths: | ||
"/orgs/{orgID}/invites": | ||
post: | ||
operationId: PostOrgsIDInvites | ||
tags: | ||
- Invites | ||
- Organizations | ||
summary: Creates an invite to an organization | ||
parameters: | ||
- $ref: "#/components/parameters/TraceSpan" | ||
- in: path | ||
name: orgID | ||
schema: | ||
type: string | ||
required: true | ||
description: The organization ID. | ||
requestBody: | ||
description: Invite to be sent | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/Invite" | ||
responses: | ||
"201": | ||
description: Invite sent | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/Invite" | ||
default: | ||
description: Unexpected error | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/Error" | ||
"/orgs/{orgID}/invites/{inviteID}": | ||
delete: | ||
operationId: DeleteOrgsIDInviteID | ||
tags: | ||
- Invites | ||
- Organizations | ||
summary: Remove an invite to an organization | ||
parameters: | ||
- $ref: "#/components/parameters/TraceSpan" | ||
- in: path | ||
name: inviteID | ||
schema: | ||
type: string | ||
required: true | ||
description: The ID of the invite to remove. | ||
- in: path | ||
name: orgID | ||
schema: | ||
type: string | ||
required: true | ||
description: The organization ID. | ||
responses: | ||
"204": | ||
description: Invite removed | ||
default: | ||
description: Unexpected error | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/Error" | ||
"/orgs/{orgID}/invites/{inviteID}/resend": | ||
post: | ||
operationId: DeleteOrgsIDInviteID | ||
tags: | ||
- Invites | ||
- Organizations | ||
summary: Re-sends an invite | ||
parameters: | ||
- $ref: "#/components/parameters/TraceSpan" | ||
- in: path | ||
name: inviteID | ||
schema: | ||
type: string | ||
required: true | ||
description: The ID of the invite to resend. | ||
- in: path | ||
name: orgID | ||
schema: | ||
type: string | ||
required: true | ||
description: The organization ID. | ||
responses: | ||
"200": | ||
description: Invite resent | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/Invite" | ||
default: | ||
description: Unexpected error | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/Error" | ||
"/orgs/{orgID}/users": | ||
get: | ||
operationId: GetUsers | ||
tags: | ||
- Users | ||
parameters: | ||
- $ref: "#/components/parameters/TraceSpan" | ||
- in: path | ||
name: orgID | ||
description: Specifies the organization ID of the User. | ||
required: true | ||
schema: | ||
type: string | ||
responses: | ||
"200": | ||
description: A list of users | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/Users" | ||
default: | ||
description: Unexpected error | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/Error" | ||
"/orgs/{orgID}/users/{userID}": | ||
delete: | ||
operationId: DeleteOrgsIDUserID | ||
tags: | ||
- Users | ||
- Organizations | ||
summary: Deletes a user | ||
parameters: | ||
- $ref: "#/components/parameters/TraceSpan" | ||
- in: path | ||
name: userID | ||
schema: | ||
type: string | ||
required: true | ||
description: The ID of the user to remove. | ||
- in: path | ||
name: orgID | ||
schema: | ||
type: string | ||
required: true | ||
description: The organization ID. | ||
responses: | ||
"204": | ||
description: User removed | ||
default: | ||
description: Unexpected error | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/Error" | ||
components: | ||
parameters: | ||
TraceSpan: | ||
in: header | ||
name: Zap-Trace-Span | ||
description: OpenTracing span context | ||
example: | ||
trace_id: "1" | ||
span_id: "1" | ||
baggage: | ||
key: value | ||
required: false | ||
schema: | ||
type: string | ||
schemas: | ||
Error: | ||
properties: | ||
code: | ||
description: Code is the machine-readable error code. | ||
readOnly: true | ||
type: string | ||
# This set of enumerations must remain in sync with the constants defined in errors.go | ||
enum: | ||
- internal error | ||
- not found | ||
- conflict | ||
- invalid | ||
- unprocessable entity | ||
- empty value | ||
- unavailable | ||
- forbidden | ||
- too many requests | ||
- unauthorized | ||
- method not allowed | ||
message: | ||
readOnly: true | ||
description: Message is a human-readable message. | ||
type: string | ||
required: [code, message] | ||
Invite: | ||
properties: | ||
id: | ||
description: the idpe id of the invite | ||
readOnly: true | ||
type: string | ||
email: | ||
type: string | ||
role: | ||
type: string | ||
enum: | ||
- member | ||
- owner | ||
expiresAt: | ||
format: date-time | ||
type: string | ||
links: | ||
type: object | ||
readOnly: true | ||
example: | ||
self: "/unity/v2/invites/1" | ||
properties: | ||
self: | ||
type: string | ||
format: uri | ||
required: [id, email, role] | ||
Invites: | ||
type: object | ||
properties: | ||
links: | ||
type: object | ||
properties: | ||
self: | ||
type: string | ||
format: uri | ||
invites: | ||
type: array | ||
items: | ||
$ref: "#/components/schemas/Invite" | ||
User: | ||
properties: | ||
id: | ||
description: the idpe id of the user | ||
readOnly: true | ||
type: string | ||
firstName: | ||
type: string | ||
lastName: | ||
type: string | ||
email: | ||
type: string | ||
role: | ||
type: string | ||
enum: | ||
- member | ||
- owner | ||
links: | ||
type: object | ||
readOnly: true | ||
example: | ||
self: "/unity/v2/users/1" | ||
properties: | ||
self: | ||
type: string | ||
format: uri | ||
required: [id, email, role] | ||
Users: | ||
type: object | ||
properties: | ||
links: | ||
type: object | ||
properties: | ||
self: | ||
type: string | ||
format: uri | ||
users: | ||
type: array | ||
items: | ||
$ref: "#/components/schemas/User" |