domaindrivendev / Swashbuckle.WebApi

Seamlessly adds a swagger to WebApi projects!
BSD 3-Clause "New" or "Revised" License
3.07k stars 678 forks source link

How to deal with dynamic propery in one class? #1026

Open stantoxt opened 7 years ago

stantoxt commented 7 years ago

If a class has a dynamic type propery,The Swagger UI Example Value is {} ,For example Class B{ public string BP1 {get;set;} public string BP2 {get;set;}} Class A{ public dynamic Data {get;set;} public string Content {get;set;}} the example would be {{"data": {},"content":""},but how to accomplish this value{{"data": {"BP1":"","BP2":""},"content":""}

heldersepu commented 7 years ago

Is this related to Swashbuckle? I think that we all agree that dynamic properties should be used sparingly.