Replies: 1 comment
-
You can exclude specific types (ExcludedTypeNames setting) but AFAIK not namespaces. I would also really like to be able to exclude all types within a namespace or with a prefix wildcard. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I recently added a new NuGet package (Hl7.Fhir.Specification.R4) to my ASP.NET Core project. After adding this package, NSwag started showing an error related to assembly scanning. I would like to exclude this specific library from being scanned by NSwag when generating the OpenAPI document.
Steps to Reproduce:
Expected Behavior:
NSwag should generate the OpenAPI document without any issues.
Actual Behavior:
NSwag throws an error related to assembly scanning, indicating it requires the assembly to have either a BuildWebHost or CreateWebHostBuilder/CreateHostBuilder method.
NSwag requires the assembly [My-Project-Assembly] to have either an BuildWebHost or CreateWebHostBuilder/CreateHostBuilder method. See https://docs.microsoft.com/en-us/aspnet/core/fundamentals/hosting?tabs=aspnetcore2x for suggestions on ways to refactor your startup type.
What I've Tried:
Checked that Program.cs has a CreateHostBuilder method.
Looked for ways to limit assembly scanning in NSwag but couldn't find a direct way to do it.
Questions:
Any help or guidance would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions