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 IncludeXmlComments overload that accepts assembly #2750

Open
leotsarev opened this issue Dec 16, 2023 · 1 comment
Open

Add IncludeXmlComments overload that accepts assembly #2750

leotsarev opened this issue Dec 16, 2023 · 1 comment
Labels
help-wanted A change up for grabs for contributions from the community

Comments

@leotsarev
Copy link
Contributor

leotsarev commented Dec 16, 2023

Hey!

Thank you for this awesome project.
Frequently I need to include Xml comments into Swagger, so I have to call IncludeXmlComments and pass here name of Xml file. It's inconvenient to hard code file name, and I have to construct it from assembly name.
I propose to include following convenience helper/overload:

public static void IncludeXmlCommentsForAssembly(
  this SwaggerGenOptions swaggerGenOptions,
  Assembly assembly,
  bool includeControllerXmlComments = false)  => 

    swaggerGenOptions.IncludeXmlComments(
      Path.Combine(AppContext.BaseDirectory, $"{assembly.GetName().Name}.xml"), 
      includeControllerXmlComments);

If you like it, I'll submit a PR

@Havunen
Copy link

Havunen commented Feb 17, 2024

Sounds good to me, you can open PR to https://github.com/Havunen/DotSwashbuckle

@martincostello martincostello added the help-wanted A change up for grabs for contributions from the community label Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help-wanted A change up for grabs for contributions from the community
Projects
None yet
Development

No branches or pull requests

3 participants