-
Notifications
You must be signed in to change notification settings - Fork 44
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
Documentation not being generated for models from NuGet packages #33
Comments
Looks like .net core 3 uses another way to reference dlls in packages so that xml docs files cannot be found. We need to repro and fix this here: |
@RicoSuter Is there a workaround for that in the meantime? This is pretty painful for us. Too late to go back to .net core 2.x unfortunately. |
Moved to Namotion.Reflection - please repro and fix here. |
Related: #23 |
Here is a repro for the bug using only Namotion as a NuGet package. I don't know why, I didn't manage to get the XML documentation of my Program class... |
PR: #34 |
Any idea how we can instruct the compiler to not only output NuGet DLLs but also the XML Docs? /cc @pranavkm sorry to bother you again - is this possible? |
I'd have thought setting |
Only outputs the xml docs for the project itself but not for the referenced NuGet packages. So this is quite the breaking change in .net core 3.0/3.1 it seems |
Ahh, are the xml files from package references no longer being copied to the output directory? |
It seems that this is not the case anymore... see my screenshots. The question is whether there is a csproj config where we can enable that again. |
I'm not entirely sure if this was a change in the 3.x SDK. You might have much better luck asking this question of https://github.com/dotnet/core-sdk/issues. |
@bpaczkowski here is a workarround RicoSuter/NSwag#2161 (comment) |
Here is other solution, copy the .xml from nuget folder to the build folder |
Ref Adding this here works for me (at least in the test project): |
v1.0.20 might be a version where this is improved but might not be fixed in all scenarios. |
It looks to be a bug in XmlDocsExtensions.GetXmlDocsPathFromNuGetCacheFile which happens on Linux: var matches = Regex.Matches(json, $"\"((.*?){assemblyName.Name}((\\\\\\\\)|(////)){assemblyName.Version.ToString(3)})((\\\\\\\\)|(////))(.*?)\"", RegexOptions.IgnoreCase); It should be a single forward slash - not four because no escaping is needed. Same could be applicable to |
I have some models exposed in my APIs that come from NuGetPackages.
While those types are properly documented (I can see the doc in intellisense), they have no documentation in the generated OpenApi spec.
This does not happen on netcoreapp2.1, but does happen on netcoreapp3.1.
To highlight this issue, please see this repro:
3.1 branch :
https://github.com/jeremyVignelles/TestNSwagNetCoreApp/blob/repro/doc-external-models/TestNSwagNetCoreApp/Hello.cs#L42
2.1 branch:
https://github.com/jeremyVignelles/TestNSwagNetCoreApp/blob/repro/doc-external-models-netcoreapp2.1/TestNSwagNetCoreApp/Hello.cs#L42
I used a type from the NSwag NuGet package to highlight the issue.
The text was updated successfully, but these errors were encountered: