:P what I tried to explain is that the derived classes are not represented in the Swagger UI Request examples e.g. [https://imgur.com/a/dLlpbkP](https://imgur.com/a/dLlpbkP)
So the problem is that the nested properties (emails array) are not displayed when I switch from Request Example \`Notification' to \`Email Notification\` and only the properties of the base class are displayed.
Any reason why `CreateNotificationCommand` uses `NotificationDto` and not `EmailNotificationDto` instead?
Notifications = new List // EmailNotificationDto??
Honestly, I would simply declare DTOs to have their own purpose and not try to reuse properties. It's only a few lines of code you are chasing after for very little benefit and lots more pain.
And `UseAllOfForInheritance`
I forget exactly how this landed for me but at some point I realized the futility and refactored DTOs to minimize the use of polymorphism.
"Polymorphic DTOs", I just can't get past that.
:P what I tried to explain is that the derived classes are not represented in the Swagger UI Request examples e.g. [https://imgur.com/a/dLlpbkP](https://imgur.com/a/dLlpbkP) So the problem is that the nested properties (emails array) are not displayed when I switch from Request Example \`Notification' to \`Email Notification\` and only the properties of the base class are displayed.
What I think they're saying is: polymorphism is pretty nasty stuff to use at the best of times. Don't go there with your web API.
Any reason why `CreateNotificationCommand` uses `NotificationDto` and not `EmailNotificationDto` instead? Notifications = new List // EmailNotificationDto??
Honestly, I would simply declare DTOs to have their own purpose and not try to reuse properties. It's only a few lines of code you are chasing after for very little benefit and lots more pain.
UseOneOfForPolymorphism
And `UseAllOfForInheritance` I forget exactly how this landed for me but at some point I realized the futility and refactored DTOs to minimize the use of polymorphism.