Add @optional
sigoden opened this issue · comments
sigoden commented
Some api may return some optional fields, which will be returned when the field has a value.
In this case, it is necessary to add an annotation @optional
{
test1: { @client("echo")
req: {
v1: 3,
// v2: 4, optional field
},
res: {
v1: 3,
v2: 4, @optional
}
}
}
Can be used with other annotations
{
test1: { @client("echo")
req: {
v1: 3,
// v2: 4, optional filed
},
res: {
v1: 3,
v2: 0, @type @optional
}
}
}