1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-06 00:07:44 +01:00
unleash.unleash/src/lib/openapi/spec/date-schema.ts
Thomas Heartman 12209ae21c
OpenAPI: clean up remaining schemas, part 1 (#4351)
Part of linear task 1-1167. Fixes the first slew of schemas missing
descriptions/examples, etc.
2023-07-28 08:45:56 +02:00

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