mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 13:59:16 +01:00
refactor(api): ♻️ Simplify route schema definitions
This commit is contained in:
parent
4926d6ff5d
commit
16f302c2dc
74 changed files with 175 additions and 254 deletions
|
|
@ -12,18 +12,14 @@ import { ApiError } from "~/classes/errors/api-error";
|
|||
import { config } from "~/packages/config-manager";
|
||||
import { ErrorSchema, type KnownEntity } from "~/types/api";
|
||||
|
||||
export const schemas = {
|
||||
param: z.object({
|
||||
id: z.string().uuid(),
|
||||
}),
|
||||
};
|
||||
|
||||
const route = createRoute({
|
||||
method: "get",
|
||||
path: "/objects/{id}",
|
||||
summary: "Get object",
|
||||
request: {
|
||||
params: schemas.param,
|
||||
params: z.object({
|
||||
id: z.string().uuid(),
|
||||
}),
|
||||
},
|
||||
responses: {
|
||||
200: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue