Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: openapi schema for user admin (#4146)
- Loading branch information
Showing
16 changed files
with
1,353 additions
and
147 deletions.
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
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
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,34 @@ | ||
import { FromSchema } from 'json-schema-to-ts'; | ||
import { userSchema } from './user-schema'; | ||
|
||
export const createUserResponseSchema = { | ||
$id: '#/components/schemas/createUserResponseSchema', | ||
type: 'object', | ||
additionalProperties: false, | ||
description: 'An Unleash user after creation', | ||
required: ['id'], | ||
properties: { | ||
...userSchema.properties, | ||
rootRole: { | ||
description: | ||
'Which [root role](https://docs.getunleash.io/reference/rbac#standard-roles) this user is assigned. Usually a numeric role ID, but can be a string when returning newly created user with an explicit string role.', | ||
oneOf: [ | ||
{ | ||
type: 'integer', | ||
example: 1, | ||
minimum: 0, | ||
}, | ||
{ | ||
type: 'string', | ||
example: 'Admin', | ||
enum: ['Admin', 'Editor', 'Viewer', 'Owner', 'Member'], | ||
}, | ||
], | ||
}, | ||
}, | ||
components: {}, | ||
} as const; | ||
|
||
export type CreateUserResponseSchema = FromSchema< | ||
typeof createUserResponseSchema | ||
>; |
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
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
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
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
Oops, something went wrong.