-
Notifications
You must be signed in to change notification settings - Fork 25
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
Controllerless WebApi documentation with multiple xml doc files #14
Comments
You can already achieve this by doing the following: var appDataPath = HostingEnvironment.MapPath("~/App_Data");
var xmlCommentsPaths = Directory.GetFiles(appDataPath, "*.xml");
foreach (string xmlCommentsPath in xmlCommentsPaths)
{
c.IncludeXmlComments(xmlCommentsPath);
var filter = new ControllerlessActionOperationFilter(xmlCommentsPath);
c.OperationFilter(() => filter);
} |
Thanks, Steven. For some reason, only the last xml file seems to work (in Swagger only comments from the last assembly appear). |
Hi @timohayes, You are right. After some testing I was able to reproduce this. The |
Thanks! I made the same changes to my project's SwaggerConfig, but for some reason it still doesn't work. I only see comments from the last xml file that is added. Is there any kind of naming convention required for the command/query/DTO assemblies? |
I tested this locally, and it works. There's no naming convention. Not sure why it doesn't work in your case. |
Strange, I even tried pulling your SolidServices solution and added a new Command/Query project to that solution, and it didn't work for me. I'm guessing this is probably an issue w/ Swashbuckle. When I get time, I'll try to debug it to see where the problem lies. Thanks again! |
Great work here! One question, regarding your Controllerless API library and xml doc files...
I see that you are copying the xml documentation file to the App_Data directory of the web api project in a post-build step. I have separated out my commands/queries into separate class libraries to facilitate re-use. In that case, how can I get the api explorer to see my xml comments from multiple assemblies? If the ControllerlessActionFilter took an array of xml doc files, it would be perfect. Perhaps something like below? Have you worked around this already?
The text was updated successfully, but these errors were encountered: