mirror of
https://github.com/detleph/server.git
synced 2026-09-04 08:36:06 +02:00
23 lines
458 B
TypeScript
23 lines
458 B
TypeScript
export enum DataType {
|
|
STRING = "string",
|
|
NUMBER = "number",
|
|
INTEGER = "integer",
|
|
PERMISSION_LEVEL = "'ELEVATED' | 'STANDARD'",
|
|
DATETIME = "ISOstring (8601)",
|
|
UUID = "UUID string",
|
|
}
|
|
|
|
interface Body {
|
|
[k: string]: DataType;
|
|
}
|
|
|
|
export function generateInvalidBodyError(body: Body) {
|
|
return {
|
|
type: "error",
|
|
payload: {
|
|
message: "The body of your request did not conform to the requirements",
|
|
schema: { body },
|
|
},
|
|
};
|
|
}
|