-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Labels
Description
Hi there,
Just found a bug. For instance if having a schema like this :
{
address: {
type: { type: String },
postalCode: String
}
}Your lib outputs :
{
address: {
type: String
}
}All properties are lost.
I fixed it by modifying 2 places :
mongoose-to-swagger/lib/index.ts
Line 56 in 82808a4
| if (type.type != null) { |
if (type.type != null) {if (type.type != null && !type.type?.type) {mongoose-to-swagger/lib/index.ts
Line 142 in 82808a4
| const subSchema = value.type ? value.type : value; |
const subSchema = value.type ? value.type : value;const subSchema = value.type && !value.type?.type ? value.type : value;I can open a PR if you want.
Cheers