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

Add example to XML param #1628

Closed
mattfrear opened this issue Apr 19, 2020 · 0 comments · Fixed by #1629
Closed

Add example to XML param #1628

mattfrear opened this issue Apr 19, 2020 · 0 comments · Fixed by #1629
Milestone

Comments

@mattfrear
Copy link
Contributor

OpenApi 3.0 supports adding examples to parameters.

https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#exampleObject

I propose adding support for this via the param XML comments:

/// <param name="keywords" example="hello">A list of search terms</param>
[HttpGet(Name = "SearchProducts")]
public IEnumerable<Product> Get([FromQuery(Name = "kw")]string keywords = "foobar")

This populates the swagger-ui form:
image

I can submit a PR for this.

Related issue: mattfrear/Swashbuckle.AspNetCore.Filters#66 (comment)

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

Successfully merging a pull request may close this issue.

2 participants