YapiHelper
使用方法
复制出yapi的JSONSchema,粘贴到ts文件中。
全选JSONSchema,右键选择【转换为类型】。
配置
类型映射
默认值
{
"number": "number",
"integer": "number",
"long": "number",
"int": "number",
"bigdecimal": "number",
"string": "string",
"boolean": "boolean"
}
设置
typeMap会生成不带注释的类型
"yapiHelper.typeMap": {
"Date": "number"
}
export interface TypeName {
startDate: number;
}
extTypeMap生成的类型会带有注释
"yapiHelper.extTypeMap": {
"Date": "number"
}
export interface TypeName {
startDate: number; // Date => number
}
| |