add openapi registers

This commit is contained in:
miloschwartz
2025-04-06 22:44:14 -04:00
parent a76e3e00f7
commit d260450a84
50 changed files with 852 additions and 60 deletions

View File

@@ -8,6 +8,7 @@ import { NextFunction, Request, Response } from "express";
import createHttpError from "http-errors";
import { z } from "zod";
import { fromError } from "zod-validation-error";
import { OpenAPITags, registry } from "@server/openApi";
const listSitesParamsSchema = z
.object({
@@ -59,6 +60,18 @@ export type ListSitesResponse = {
pagination: { total: number; limit: number; offset: number };
};
registry.registerPath({
method: "get",
path: "/org/{orgId}/sites",
description: "List all sites in an organization",
tags: [OpenAPITags.Org, OpenAPITags.Site],
request: {
params: listSitesParamsSchema,
query: listSitesSchema
},
responses: {}
});
export async function listSites(
req: Request,
res: Response,