dotnet / dotnet/aspnetcore

Add OpenApiOption property to disable OpenAPI XML documentation generation

Open
#67,937 1 comment 0 reactions 0 assignees View on GitHub
area-minimal feature-openapi
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

I am currently using NuGet packages that require `` to be set to `true`.

Unfortunately, `Microsoft.AspNetCore.OpenApi` will generate OpenAPI documentation based on our XML comments when that flag is enabled, and there doesn't seem to be any way to disable it outside of editing the csproj file.

### Describe the solution you'd like

Adding a way to disable the XML documentation via the `OpenApiOptions` object would be appreciated.

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start at OpenApiOptions and trace the Microsoft.AspNetCore.OpenApi path that reads XML comments when GenerateDocumentationFile is enabled. Review the relevant OpenAPI tests and add coverage showing the new option disables XML documentation generation while the default behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, openapi
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.