-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschemas.ts
43 lines (40 loc) · 1.08 KB
/
schemas.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { z } from "@hono/zod-openapi";
export const EmojiVersionSchema = z.object({
draft: z.boolean().openapi({
description: "Whether the version is a draft",
example: false,
}),
emoji_version: z.string().nullable().openapi({
description: "The emoji version",
example: "16.0",
}),
unicode_version: z.string().nullable().openapi({
description: "The Unicode version that corresponds to the emoji version",
example: "14.0",
}),
});
export const ApiErrorSchema = z.object({
path: z.string().openapi({
description: "The path of the request",
}),
message: z.string().openapi({
description: "The error message",
}),
status: z.number().openapi({
description: "The HTTP status code",
}),
timestamp: z.string().openapi({
description: "The timestamp of the error",
}),
}).openapi("ApiError", {
description: "An error response",
});
export const EMOJI_LOCK_SCHEMA = z.object({
versions: z.array(
z.object({
emoji_version: z.string().nullable(),
unicode_version: z.string().nullable(),
draft: z.boolean(),
}),
),
});