mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-04 09:46:40 +00:00
add openapi registers
This commit is contained in:
@@ -8,6 +8,7 @@ import HttpCode from "@server/types/HttpCode";
|
||||
import createHttpError from "http-errors";
|
||||
import logger from "@server/logger";
|
||||
import { fromError } from "zod-validation-error";
|
||||
import { OpenAPITags, registry } from "@server/openApi";
|
||||
|
||||
const deleteRoleSchema = z
|
||||
.object({
|
||||
@@ -21,6 +22,24 @@ const deelteRoleBodySchema = z
|
||||
})
|
||||
.strict();
|
||||
|
||||
registry.registerPath({
|
||||
method: "delete",
|
||||
path: "/role/{roleId}",
|
||||
description: "Delete a role.",
|
||||
tags: [OpenAPITags.Role],
|
||||
request: {
|
||||
params: deleteRoleSchema,
|
||||
body: {
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: deelteRoleBodySchema
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
responses: {}
|
||||
});
|
||||
|
||||
export async function deleteRole(
|
||||
req: Request,
|
||||
res: Response,
|
||||
|
||||
Reference in New Issue
Block a user