tsoa
tsoa copied to clipboard
Duplicated swagger $refs on `Entity | Promise<Entity>` types
Sorting
-
I'm submitting a ...
- [?] bug report
- [x] feature request
-
I confirm that I
- [x] used the search to make sure that a similar issue hasn't already been submit
Expected Behavior
im using tsoa with typeorm with lazy loading:
export interface IUser extends _IBaseEntity {
uuid: string;
account: IAccount | Promise<IAccount>;
}
@Entity()
export class User extends _BaseUUIDEntity<User> implements IUser {
@PrimaryColumn({ type: 'uuid' })
public uuid: string;
@ManyToOne(_type => Account, account => account.uuid, { lazy: true })
@JoinColumn({ name: 'account_uuid' })
public account: Promise<Account> | Account;
}
Current Behavior
after building swagger.json file i got this:
{
"User": {
"properties": {
"uuid": {
"type": "string"
},
"account": {
"anyOf": [
{
"$ref": "#/components/schemas/Account"
},
{
"$ref": "#/components/schemas/Account"
}
]
}
},
"type": "object",
"additionalProperties": false
},
}
Version of the library:
- tsoa: 3.2.1@latest
- typeorm: 0.2.25@latest
- Confirm you were using yarn not npm: [x]
Detailed Description
filter refs and remove duplicated