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

Swashbuckle.AspNetCore 6.9.0, fix for inheritdocs

Open alser opened this issue 1 year ago • 1 comments

Related to #38

  1. Upped NuGets (bug is only observable in newest Swashbuckle's releases).
  2. Added stinking reflection for acquiring private field XmlCommentsSchemaFilter._xmlDocMembers. Don't know a better way w/o proposing modifications in Swashbuckle's API. If its broken in the next Swashbuckle release, then NotSupportedException will throw.
  3. XPathDocument tries to load again for each xml file from the BaseURI (usually its file:///).
    • If SwaggerGenOptions.IncludeXmlComments is called with string filePath or () => new XPathDocument(uri), then all is ok.
    • But if user calls something like new XPathDocument(new StringReader(File.ReadAllText(filePath))) - it's bad, no inheritdocs will be resolved from that file.
  4. Because of the last one, fixed NRE in InheritDocOperationFilter, so that swagger will not fail although displaying non-resolved inheritdocs.

alser avatar Oct 15 '24 17:10 alser

Got some problem with CI, sdk version maybe...

Build.ps1 fails when in folder src\Unchase.Swashbuckle.AspNetCore.Extensions it calls:

dotnet pack -c Release -o ..\..\artifacts

locally I get ok-ish build with warnings, and nupkg artifact is ok:

  Determining projects to restore...
  All projects are up-to-date for restore.
C:\Program Files\dotnet\sdk\8.0.403\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): warning NU
5048: The 'PackageIconUrl'/'iconUrl' element is deprecated. Consider using the 'PackageIcon'/'icon' element instead. Le
arn more at https://aka.ms/deprecateIconUrl [C:\Projects\Unchase.Swashbuckle.AspNetCore.Extensions\src\Unchase.Swashbuc
kle.AspNetCore.Extensions\Unchase.Swashbuckle.AspNetCore.Extensions.csproj]
  The package Unchase.Swashbuckle.AspNetCore.Extensions.2.7.1 is missing a readme. Go to https://aka.ms/nuget/authoring
  -best-practices/readme to learn why package readmes are important.
  Successfully created package 'C:\Projects\Unchase.Swashbuckle.AspNetCore.Extensions\artifacts\Unchase.Swashbuckle.Asp
  NetCore.Extensions.2.7.1.nupkg'.

CI shows this:

  Determining projects to restore...
  All projects are up-to-date for restore.
C:\Program Files\dotnet\sdk\8.0.401\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5):
error NU5026: The file 'C:\projects\unchase-swashbuckle-aspnetcore-extensions\src\
Unchase.Swashbuckle.AspNetCore.Extensions\bin\Any CPU\Release\netstandard2.0\
Unchase.Swashbuckle.AspNetCore.Extensions.dll' to be packed was not found on disk.
[C:\projects\unchase-swashbuckle-aspnetcore-extensions\src\Unchase.Swashbuckle.AspNetCore.Extensions\Unchase.Swashbuckle.AspNetCore.Extensions.csproj]

It tries to find dll in bin\Any CPU\Release\netstandard2.0, but it is actually in bin\Release\netstandard2.0

alser avatar Oct 15 '24 18:10 alser

Thank you @alser for providing the PR. I had to make manual edits due to a broken CI/CD from AppVeyor.

unchase avatar Dec 17 '24 22:12 unchase