summaryrefslogtreecommitdiff
path: root/src/schemas.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/schemas.ts')
-rw-r--r--src/schemas.ts26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/schemas.ts b/src/schemas.ts
index 1b858ff..669674a 100644
--- a/src/schemas.ts
+++ b/src/schemas.ts
@@ -1,6 +1,18 @@
-import { z } from "zod";
+import { z } from "@hono/zod-openapi";
-export const list = z.object({
+const ErrorResponse = z.string().optional().openapi({
+ description: "Error message reported by server",
+});
+
+const TeawieURLResponse = z.object({
+ url: z.string().url().optional().openapi({
+ description: "URL to Teawie",
+ }),
+
+ error: ErrorResponse,
+});
+
+export const ListTeawiesParams = z.object({
limit: z
.string()
.optional()
@@ -8,5 +20,15 @@ export const list = z.object({
.refine((data) => {
const parsed = parseInt(data);
return !isNaN(parsed);
+ })
+ .openapi({
+ description: "Maximum number of Teawie URLs to be returned",
}),
});
+
+export const ListTeawiesResponse = z.object({
+ urls: z.array(z.string().url()).optional(),
+ error: ErrorResponse,
+});
+
+export const RandomTeawiesResponse = TeawieURLResponse;