1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-10-27 11:02:16 +01:00
unleash.unleash/src/lib/openapi/spec/change-password-schema.ts
Christopher Kolstad 0b18491237
docs: Auth tag (#4126)
## 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>
2023-07-04 08:31:54 +00:00

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>;