Swashbuckle.WebApi icon indicating copy to clipboard operation
Swashbuckle.WebApi copied to clipboard

Cannot add XML documentation for object read with [FromQuery] attribute

Open kikaragyozov opened this issue 4 years ago • 0 comments

When objects are mapped from the body, we can add description for each of the properties by using the XML <param> tag and then outlining in full detail the contents of the object.

But, if the object is being mapped from the query string, I have no control over it when using <param> XML tag. Swagger UI simply ignores whatever I write in there. It populates the properties correctly, allowing the users to input things into them, but neither (as before) can I use nested XML summary tags on properties to add clarification as to what they are used for (because swagger up to now does not support this), but the possible workaround with the <param> tag is now also not available.

The only possible solution to this, is to dump all of my tooltips in the <remark> section of my documentation, which is a bit uconventional.

To the question "Why use [FromQuery] with an object?" - because I'm passing 10 parameters, in a GET request and it's better they are in an object for more easier refactoring than having a method signature of 3 lines of code.

kikaragyozov avatar Jun 24 '20 11:06 kikaragyozov