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
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