mirror of
https://github.com/Unleash/unleash.git
synced 2025-10-27 11:02:16 +01:00
## What This adds openapi documentation for the Auth tagged operations and connected schemas. ## Discussion points Our user schema seems to be exposing quite a bit of internal fields, I flagged the isApi field as deprecated, I can imagine quite a few of these fields also being deprecated to prepare for removal in next major version, but I was unsure which ones were safe to do so with. ## Observation We have some technical debt around the shape of the schema we're claiming we're returning and what we actually are returning. I believe @gastonfournier also observed this when we turned on validation for our endpoints. --------- Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
27 lines
890 B
TypeScript
27 lines
890 B
TypeScript
import { FromSchema } from 'json-schema-to-ts';
|
|
|
|
export const changePasswordSchema = {
|
|
$id: '#/components/schemas/changePasswordSchema',
|
|
type: 'object',
|
|
additionalProperties: false,
|
|
required: ['token', 'password'],
|
|
description: 'Change password as long as the token is a valid token',
|
|
properties: {
|
|
token: {
|
|
description:
|
|
'A reset token used to validate that the user is allowed to change the password.',
|
|
type: 'string',
|
|
example:
|
|
'$2a$15$QzeW/y5/MEppCWVEkoX5euejobYOLSd4We21LQjjKlWH9l2I3wCke',
|
|
},
|
|
password: {
|
|
type: 'string',
|
|
description: 'The new password for the user',
|
|
example: 'correct horse battery staple',
|
|
},
|
|
},
|
|
components: {},
|
|
} as const;
|
|
|
|
export type ChangePasswordSchema = FromSchema<typeof changePasswordSchema>;
|