Skip to content
Purview Dev logo

Configuration

Preview OpenAPI XmlComments Reviewed 2026-11-03 purview-dev/openapi-xmlcomments Star on GitHub agent-skills aspnetcore build-tooling csharp dotnet msbuild nuget openapi source-generator xml-comments xml-documentation

Nothing needs configuring for the common case. Everything below is MSBuild, set in the API project or in Directory.Build.props.

SettingDefaultEffect
<PurviewOpenAPIXmlCommentDeduplication>false</PurviewOpenAPIXmlCommentDeduplication>trueTurns the package off: neither target runs.
<PurviewOpenAPIXmlCommentExclude Include="T:Some.Type" />noneRemoves that ID from every referenced documentation file even when it occurs once. Normalised like every other ID, so a method ID may be written with or without its ~ReturnType suffix.

POAX001 is an ordinary MSBuild warning (see Diagnostics):

<PropertyGroup>
<!-- fail the build instead -->
<MSBuildWarningsAsErrors>$(MSBuildWarningsAsErrors);POAX001</MSBuildWarningsAsErrors>
<!-- or silence it -->
<MSBuildWarningsAsMessages>$(MSBuildWarningsAsMessages);POAX001</MSBuildWarningsAsMessages>
</PropertyGroup>

Every removal is logged at normal verbosity:

dotnet build -v:n
...
OpenAPI XML comments: removed 'T:Ambient.InjectedAttribute' from Lib.A, Lib.B (duplicate).

The filtered copies are in obj/<configuration>/<tfm>/purview-openapi-xml/. With <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>, the generator’s cache is in obj/.../generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/.../OpenApiXmlCommentSupport.generated.cs, where each ID should now appear once.