mirror of
https://github.com/fosrl/pangolin.git
synced 2026-07-21 04:56:40 +02:00
Add concrete OpenAPI data schemas for selected routes
Agent-Logs-Url: https://github.com/fosrl/pangolin/sessions/7b395a8e-7fae-4f4d-952e-4030fea08262 Co-authored-by: oschwartz10612 <4999704+oschwartz10612@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
a0a093ed0b
commit
15a9eb28d9
@@ -1,5 +1,6 @@
|
||||
import { Request, Response, NextFunction } from "express";
|
||||
import { z } from "zod";
|
||||
import { createApiResponseSchema } from "@server/lib/openapi/createApiResponseSchema";
|
||||
import { db } from "@server/db";
|
||||
import {
|
||||
orgs,
|
||||
@@ -67,6 +68,8 @@ export type InviteUserResponse = {
|
||||
inviteLink: string;
|
||||
expiresAt: number;
|
||||
};
|
||||
const InviteUserResponseDataSchema = z.object({inviteLink: z.string(), expiresAt: z.number()});
|
||||
|
||||
|
||||
registry.registerPath({
|
||||
method: "post",
|
||||
@@ -88,13 +91,7 @@ registry.registerPath({
|
||||
description: "Successful response",
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: z.object({
|
||||
data: z.unknown().nullable(),
|
||||
success: z.boolean(),
|
||||
error: z.boolean(),
|
||||
message: z.string(),
|
||||
status: z.number()
|
||||
})
|
||||
schema: createApiResponseSchema(InviteUserResponseDataSchema)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user