server/packages/client/schemas/rule.ts
Jesse Wierzbinski 58342e86e1
refactor(api): ♻️ Move from @hono/zod-openapi to hono-openapi
hono-openapi is easier to work with and generates better OpenAPI definitions
2025-03-29 03:30:06 +01:00

25 lines
746 B
TypeScript

import { z } from "zod";
export const Rule = z
.object({
id: z.string().openapi({
description: "The identifier for the rule.",
example: "1",
}),
text: z.string().openapi({
description: "The rule to be followed.",
example: "Do not spam pictures of skibidi toilet.",
}),
hint: z.string().optional().openapi({
description: "Longer-form description of the rule.",
example: "Please, we beg you.",
}),
})
.openapi({
description: "Represents a rule that server users should follow.",
externalDocs: {
url: "https://docs.joinmastodon.org/entities/Rule",
},
ref: "Rule",
});