-
Notifications
You must be signed in to change notification settings - Fork 679
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
Enhancement: Include <summary> comments for enum values #1290
Comments
Since there is no fix yet, I'll post what I did to workaround the issue. I've created a simple Schema filter that apply to all enum, and simply build the description. It boils down to this:
The full implementation is available on my repo. Then, just add it as a filter in your startup class.
Results before applying the filter
Results after applying the filter
Still not perfect, but it's better than nothing. The repo is available here should someone need it. |
@Justin-Lessard this line is not working with Swashbuckle.AspNetCore v5.1.0: |
@pfaustinopt |
As a work-around, I was able to re-use the code here: |
Are there plans to implement this? |
If you call UseReferencedDefinitionsForEnums() in services.AddSwaggerGen() lambda, Xml comments are ignored for enum types.
VERSION:
Swashbuckle.AspNetCore 4.0.1
STEPS TO REPRODUCE:
See the sample classes below.
EXPECTED RESULT:
When reviewing Models at the swagger URL, Foo should look as follows:
ACTUAL RESULT:
ADDITIONAL DETAILS
The text was updated successfully, but these errors were encountered: