能否增加配置项:在RequestDataType和ResponseDataType的注释中增加title
YujiaCheng1996 opened this issue · 0 comments
YujiaCheng1996 commented
高版本的yapi支持title和desc,希望在请求响应的类型注释中增加每一项的title。
如JsonSchema:
requestDataJsonSchema: {
title: '测试注册表单',
description: 'A simple form example.',
type: 'object',
required: ['firstName', 'lastName'],
'ui:order': ['lastName', 'firstName', '*', 'password'],
properties: {
firstName: { type: 'string', title: 'First name', default: 'Jun' },
lastName: { type: 'string', title: 'Last name', 'ui:options': { description: '请输入你的姓' }, 'err:required': '必须输入Last Name' },
price: { type: 'string', description: '最多输入两位小数点,最大值 999999.99', title: '价格', format: 'price' },
age: { type: 'integer', title: 'Age', maximum: 80, minimum: 16 },
bio: { type: 'string', title: 'Bio', minLength: 10 },
password: { type: 'string', title: 'Password', minLength: 3 },
telephone: { type: 'string', title: 'Telephone', minLength: 10 },
},
},
生成的接口为:
export interface PostApiTestTestRequest {
firstName: string;
lastName: string;
/**
* 最多输入两位小数点,最大值 999999.99
*/
price?: string;
age?: number;
bio?: string;
password?: string;
telephone?: string;
}
希望增加title的注释为:
/**
* First name
*/
firstName: string;
/**
* 价格
* 最多输入两位小数点,最大值 999999.99
*/
price?: string;