openapi-tsk
Version:
openapi tool to use with NodeTskeleton template project
50 lines (49 loc) • 1.1 kB
TypeScript
export { ZodObject } from "zod";
export declare enum PropTypeEnum {
STRING = "string",
NUMBER = "number",
BOOLEAN = "boolean",
OBJECT = "object",
ARRAY = "array",
DATE = "date",
NULL = "null",
UNDEFINED = "undefined",
PRIMITIVE = "primitive",
UNKNOWN = "unknown"
}
export declare enum PropFormatEnum {
INT_64 = "int64",
INT_32 = "int32",
FLOAT = "float",
DATE_TIME = "date-time",
DATE = "date",
TIME = "time",
EMAIL = "email",
URI = "uri",
UUID = "uuid",
PASSWORD = "password",
TEXT = "text",
BASE64 = "base64"
}
export type ClassProperty = {
type: PropTypeEnum;
format?: PropFormatEnum;
nullable?: boolean;
readonly?: boolean;
required?: boolean;
minimum?: number;
maximum?: number;
items?: {
type: PropTypeEnum;
};
enum?: string[];
$ref?: string;
};
export type OpenAPISchema = {
type: PropTypeEnum;
format?: PropFormatEnum;
properties: Record<string, ClassProperty>;
items?: ClassProperty;
required?: string[];
enum?: string[];
};