import {z} from "@hono/zod-openapi";

const responseSchema = z.object({
    success: z.boolean().openapi({example: true}),
    message: z.string().optional(),
    data: z
    .array(z.object({}).optional())
    .optional()
    .openapi({example: [{data: "hi"}]}),
});

export const responses = () => {
    return {
        200: {
            content: {
                "application/json": {schema: responseSchema},
            },
            description: "Response message",
        },
        400: {
            content: {
                "application/json": {
                    schema: z.object({message: z.string().optional().openapi({example: "Internal Server error"})}),
                },
            },
            description: "Internal Server Error",
        },
        401: {
            content: {
                "application/json": {
                    schema: z.object({message: z.string().optional().openapi({example: "Unauthenticated"})}),
                },
            },
            description: "Unauthorized",
        },
        500: {
            content: {
                "application/json": {
                    schema: z.object({message: z.string().optional().openapi({example: "Internal Server error"})}),
                },
            },
            description: "Internal Server Error",
        },
    };
};
