mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-06 00:07:44 +01:00
12209ae21c
Part of linear task 1-1167. Fixes the first slew of schemas missing descriptions/examples, etc.
26 lines
778 B
TypeScript
26 lines
778 B
TypeScript
import { FromSchema } from 'json-schema-to-ts';
|
|
|
|
export const dateSchema = {
|
|
$id: '#/components/schemas/dateSchema',
|
|
description:
|
|
'A representation of a date. Either as a date-time string or as a UNIX timestamp.',
|
|
oneOf: [
|
|
{
|
|
type: 'string',
|
|
format: 'date-time',
|
|
description:
|
|
'An [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339.html)-compliant timestamp.',
|
|
example: '2023-07-27T11:23:44Z',
|
|
},
|
|
{
|
|
type: 'integer',
|
|
description:
|
|
'A [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time).',
|
|
example: 1690449593,
|
|
},
|
|
],
|
|
components: {},
|
|
} as const;
|
|
|
|
export type DateSchema = FromSchema<typeof dateSchema>;
|