add clients openapi registries

This commit is contained in:
miloschwartz
2025-04-20 17:00:45 -04:00
parent fa6fc9e80d
commit 490ddfcd88
6 changed files with 90 additions and 18 deletions

View File

@@ -11,6 +11,7 @@ import createHttpError from "http-errors";
import logger from "@server/logger";
import { eq, and } from "drizzle-orm";
import { fromError } from "zod-validation-error";
import { OpenAPITags, registry } from "@server/openApi";
const updateClientParamsSchema = z
.object({
@@ -27,6 +28,24 @@ const updateClientSchema = z
export type UpdateClientBody = z.infer<typeof updateClientSchema>;
registry.registerPath({
method: "post",
path: "/client/{clientId}",
description: "Update a client by its client ID.",
tags: [OpenAPITags.Client],
request: {
params: updateClientParamsSchema,
body: {
content: {
"application/json": {
schema: updateClientSchema
}
}
}
},
responses: {}
});
export async function updateClient(
req: Request,
res: Response,
@@ -121,4 +140,4 @@ export async function updateClient(
createHttpError(HttpCode.INTERNAL_SERVER_ERROR, "An error occurred")
);
}
}
}