jezzsantos / saastack

A comprehensive codebase template for starting your real-world, fully featured SaaS web products. On the .NET platform
The Unlicense
36 stars 9 forks source link

API Documentation not using XML Docs #35

Closed jezzsantos closed 3 months ago

jezzsantos commented 4 months ago

At present we are defining a custom description, with expected errors in the XML docs of specific RequestDTO's, and then we are using the Source Generator to copy that data into the generated minimal API definitions, and including that data in the Swagger docs.

This works great when running the Rislyn source generator manually (in the Rider IDE). But when the source generator is run as part of the MSBUILD build, the data is not available to the source generator.

We think this is because when the build occurs, the XML documentation files, even though they are present on the disk in the output directory of the assembly that needs to read them, the source generator is not reading them for some reason.

We don't know why the source generator is not loading them into its compilation, but the data is not there in the source generator when it runs.

We suspect that we have to write some code to load those files at compilation time. We have a request to the Roslyn team asking how we do that: https://github.com/dotnet/roslyn/issues/23673