我有一个类,其中一个属性可以是字符串或字符串数组,不知道如何在 swagger 中定义它
@ApiProperty({
description: `to email address`,
type: ???, <- what should be here?
required: true,
})
to: string | Array<string>;
Run Code Online (Sandbox Code Playgroud)
我试过
@ApiProperty({
description: `to email address(es)`,
additionalProperties: {
oneOf: [
{ type: 'string' },
{ type: 'Array<string>' },
],
},
required: true,
})
Run Code Online (Sandbox Code Playgroud)
和
@ApiProperty({
description: `to email address(es)`,
additionalProperties: {
oneOf: [
{ type: 'string' },
{ type: 'string[]' },
],
},
required: true,
})
Run Code Online (Sandbox Code Playgroud)
和
@ApiProperty({
description: `to email address(es)`,
additionalProperties: {
oneOf: [
{ type: …Run Code Online (Sandbox Code Playgroud)