Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Xml comments not picked up when using an array in the list of params in the controller #588

Closed
tynor88 opened this issue Dec 22, 2015 · 3 comments

Comments

@tynor88
Copy link

tynor88 commented Dec 22, 2015

When having an attribute in the param list in the controller

[BindUnknownParams] KeyValuePair<string, string>[] metadata = null

Like this:

        /// <summary>
        /// Gets a list of data by it's metadata key/value pairs
        /// </summary>
        /// <param name="timeZone">The timezone for which the requested data will be returned in (default:UTC)</param>
        /// <param name="metadata">Metadata key-value pairs to search for in the format: key=value</param>
        /// <returns>A list of datasets</returns>
        [Route("Test")]
        public async Task<IHttpActionResult> Test(ETimeZone timeZone = ETimeZone.UTC, [BindUnknownParams] KeyValuePair<string, string>[] metadata = null)
        {
            return Ok();
        }

Swashbuckle does not pickup the Xml document (Summary, Remarks etc.)

image

The description/summary properties in the Operation object are null aswell, when creating an OperationFilter:

image

If the attribute is not there, the xml comments are picked up with no problems. Any idea how to fix this?

@tynor88
Copy link
Author

tynor88 commented Dec 22, 2015

Might be related to #227 but the issue has been closed.

@niemyjski did you find a work-around?

@tynor88
Copy link
Author

tynor88 commented Dec 22, 2015

Changing it to IEnumerable instead of an array fixes the problem, so it's not the attribute, but the array causing the issue like in #227.

This works:

[BindUnknownParams] IEnumerable<KeyValuePair<string, string>> metadata = null

@tynor88 tynor88 changed the title Bug: Xml comments not picked up when using an attribute in the list of params in the controller Bug: Xml comments not picked up when using an array in the list of params in the controller Dec 22, 2015
@domaindrivendev
Copy link
Owner

See 5.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants