Swashbuckle.AspNetCore icon indicating copy to clipboard operation
Swashbuckle.AspNetCore copied to clipboard

Consider making more types internal

Open martincostello opened this issue 10 months ago • 3 comments

Review the public API and see if there's any types that are public that don't need to be, such as SwaggerMiddleware. That gives us more agility to change implementation details, like adding new constructor overloads (see #2801).

It may be that some types don't need to be public and are only done so through oversight or to be accessible to unit tests. In the case of tests, it might be too tricky to do with the way that some assemblies are strong named and others aren't, as [InternalsVisibleTo] requires IVT'd assemblies to also be strong named, and all dependencies of a project need to be strong named for it to be, which creates issues where a test project depends on one project that is signed and another that isn't.

Context: https://github.com/domaindrivendev/Swashbuckle.AspNetCore/pull/2418#discussion_r1566514729

martincostello avatar Apr 16 '24 09:04 martincostello

This issue is stale because it has been open for 60 days with no activity. It will be automatically closed in 14 days if no further updates are made.

github-actions[bot] avatar Jun 20 '24 01:06 github-actions[bot]

You can also specify InternalsVisibleTo inside the .csproj file which doesn't require any funny business with assemblies:

<ItemGroup>
     <InternalsVisibleTo Include='Swashbuckle.AspNetCore.SomeTestProject' />
</ItemGroup

ahoke-cr avatar Aug 19 '24 14:08 ahoke-cr

Good point, we do that here already:

https://github.com/domaindrivendev/Swashbuckle.AspNetCore/blob/28128ebb4e6d809686036d1e4e45b6cd08e5d6ba/src/Swashbuckle.AspNetCore.SwaggerGen/Swashbuckle.AspNetCore.SwaggerGen.csproj#L14-L17

martincostello avatar Aug 19 '24 14:08 martincostello