Skip to content

fix: OpenAPI request body description uses correct parameter comment - #65898

Closed
BloodShop wants to merge 4 commits into
dotnet:mainfrom
BloodShop:fix/openapi-request-body-description-clean
Closed

BloodShop wants to merge 4 commits into
dotnet:mainfrom
BloodShop:fix/openapi-request-body-description-clean

Merge branch 'main' into fix/openapi-request-body-description-clean

aaf66ae
Select commit
Loading
Failed to load commit list.
Azure Pipelines / aspnetcore-ci failed Mar 22, 2026 in 1h 3m 33s

Build #20260322.6 had test failures

Details

Tests

  • Failed: 73 (0.06%)
  • Passed: 119,736 (98.96%)
  • Other: 1,181 (0.98%)
  • Total: 120,990

Annotations

Check failure on line 91 in .packages\microsoft.dotnet.helix.sdk\11.0.0-beta.26153.117\tools\Microsoft.DotNet.Helix.Sdk.MultiQueue.targets

See this annotation in the file changed.

@azure-pipelines azure-pipelines / aspnetcore-ci

.packages\microsoft.dotnet.helix.sdk\11.0.0-beta.26153.117\tools\Microsoft.DotNet.Helix.Sdk.MultiQueue.targets#L91

.packages\microsoft.dotnet.helix.sdk\11.0.0-beta.26153.117\tools\Microsoft.DotNet.Helix.Sdk.MultiQueue.targets(91,5): error : (NETCORE_ENGINEERING_TELEMETRY=Test) Work item Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests--net11.0 in job 4864e51d-5907-4252-939c-20f733ba3b2f has failed.
Failure log: https://helix.dot.net/api/2019-06-17/jobs/4864e51d-5907-4252-939c-20f733ba3b2f/workitems/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests--net11.0/console

Check failure on line 91 in .packages\microsoft.dotnet.helix.sdk\11.0.0-beta.26153.117\tools\Microsoft.DotNet.Helix.Sdk.MultiQueue.targets

See this annotation in the file changed.

@azure-pipelines azure-pipelines / aspnetcore-ci

.packages\microsoft.dotnet.helix.sdk\11.0.0-beta.26153.117\tools\Microsoft.DotNet.Helix.Sdk.MultiQueue.targets#L91

.packages\microsoft.dotnet.helix.sdk\11.0.0-beta.26153.117\tools\Microsoft.DotNet.Helix.Sdk.MultiQueue.targets(91,5): error : (NETCORE_ENGINEERING_TELEMETRY=Test) Work item Microsoft.AspNetCore.SignalR.Client.Tests--net11.0 in job 4864e51d-5907-4252-939c-20f733ba3b2f has failed.
Failure log: https://helix.dot.net/api/2019-06-17/jobs/4864e51d-5907-4252-939c-20f733ba3b2f/workitems/Microsoft.AspNetCore.SignalR.Client.Tests--net11.0/console

Check failure on line 91 in .packages\microsoft.dotnet.helix.sdk\11.0.0-beta.26153.117\tools\Microsoft.DotNet.Helix.Sdk.MultiQueue.targets

See this annotation in the file changed.

@azure-pipelines azure-pipelines / aspnetcore-ci

.packages\microsoft.dotnet.helix.sdk\11.0.0-beta.26153.117\tools\Microsoft.DotNet.Helix.Sdk.MultiQueue.targets#L91

.packages\microsoft.dotnet.helix.sdk\11.0.0-beta.26153.117\tools\Microsoft.DotNet.Helix.Sdk.MultiQueue.targets(91,5): error : (NETCORE_ENGINEERING_TELEMETRY=Test) Work item Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests--net11.0 in job 48a254d1-03c7-4215-93e1-23d211cd7b55 has failed.
Failure log: https://helix.dot.net/api/2019-06-17/jobs/48a254d1-03c7-4215-93e1-23d211cd7b55/workitems/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests--net11.0/console

Check failure on line 91 in .packages\microsoft.dotnet.helix.sdk\11.0.0-beta.26153.117\tools\Microsoft.DotNet.Helix.Sdk.MultiQueue.targets

See this annotation in the file changed.

@azure-pipelines azure-pipelines / aspnetcore-ci

.packages\microsoft.dotnet.helix.sdk\11.0.0-beta.26153.117\tools\Microsoft.DotNet.Helix.Sdk.MultiQueue.targets#L91

.packages\microsoft.dotnet.helix.sdk\11.0.0-beta.26153.117\tools\Microsoft.DotNet.Helix.Sdk.MultiQueue.targets(91,5): error : (NETCORE_ENGINEERING_TELEMETRY=Test) Work item Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests--net11.0 in job f756c5cc-387b-442c-a7a8-d95c06107bda has failed.
Failure log: https://helix.dot.net/api/2019-06-17/jobs/f756c5cc-387b-442c-a7a8-d95c06107bda/workitems/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests--net11.0/console

Check failure on line 1 in Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests.AdditionalTextsTests.CanHandleXmlForSchemasInAdditionalTexts

See this annotation in the file changed.

@azure-pipelines azure-pipelines / aspnetcore-ci

Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests.AdditionalTextsTests.CanHandleXmlForSchemasInAdditionalTexts

VerifyException : Directory: /datadisks/disk1/work/AC8E0989/w/B5490980/e/snapshots
NotEqual:
  - Received: AdditionalTextsTests.CanHandleXmlForSchemasInAdditionalTexts#OpenApiXmlCommentSupport.generated.received.cs
    Verified: AdditionalTextsTests.CanHandleXmlForSchemasInAdditionalTexts#OpenApiXmlCommentSupport.generated.verified.cs

FileContent:

NotEqual:

Received: AdditionalTextsTests.CanHandleXmlForSchemasInAdditionalTexts#OpenApiXmlCommentSupport.generated.received.cs
//HintName: OpenApiXmlCommentSupport.generated.cs
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
// Suppress warnings about obsolete types and members
// in generated code
#pragma warning disable CS0612, CS0618

namespace System.Runtime.CompilerServices
{
    [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
    file sealed class InterceptsLocationAttribute : System.Attribute
    {
        public InterceptsLocationAttribute(int version, string data)
        {
        }
    }
}

namespace Microsoft.AspNetCore.OpenApi.Generated
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics.CodeAnalysis;
    using System.Globalization;
    using System.Linq;
    using System.Reflection;
    using System.Text;
    using System.Text.Json;
    using System.Text.Json.Nodes;
    using System.Threading;
    using System.Threading.Tasks;
    using Microsoft.AspNetCore.OpenApi;
    using Microsoft.AspNetCore.Mvc.Controllers;
    using Microsoft.AspNetCore.Mvc.ModelBinding.Metadata;
    using Microsoft.Extensions.DependencyInjection;
    using Microsoft.OpenApi;

    [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
    file record XmlComment(
        string? Summary,
        string? Description,
        string? Remarks,
        string? Returns,
        string? Value,
        bool Deprecated,
        List<string>? Examples,
        List<XmlParameterComment>? Parameters,
        List<XmlResponseComment>? Responses);

    [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
    file record XmlParameterComment(string? Name, string? Description, string? Example, bool Deprecated);

    [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
    file record XmlResponseComment(string Code, string? Description, string? Example);

    [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
    file static class XmlCommentCache
    {
        private static Dictionary<string, XmlComment>? _cache;
        public static Dictionary<string, XmlComment> Cache => _cache ??= GenerateCacheEntries();

        private static Dictionary<string, XmlComment> GenerateCacheEntries()
        {
            var cache = new Dictionary<string, XmlComment>();
            cache.Add(@"T:ClassLibrary.Todo", new XmlComment(@"This is a todo item.", null, null, null, null, false, null, null, null));
            cache.Add(@"T:ClassLibrary.Project", new XmlComment(@"The project that contains Todo items.", null, null, null, null, false, null, null, null)

Check failure on line 1 in Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests.AddOpenApiTests.CanInterceptAddOpenApi

See this annotation in the file changed.

@azure-pipelines azure-pipelines / aspnetcore-ci

Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests.AddOpenApiTests.CanInterceptAddOpenApi

VerifyException : Directory: /datadisks/disk1/work/AC8E0989/w/B5490980/e/snapshots
NotEqual:
  - Received: AddOpenApiTests.CanInterceptAddOpenApi#OpenApiXmlCommentSupport.generated.received.cs
    Verified: AddOpenApiTests.CanInterceptAddOpenApi#OpenApiXmlCommentSupport.generated.verified.cs

FileContent:

NotEqual:

Received: AddOpenApiTests.CanInterceptAddOpenApi#OpenApiXmlCommentSupport.generated.received.cs
//HintName: OpenApiXmlCommentSupport.generated.cs
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
// Suppress warnings about obsolete types and members
// in generated code
#pragma warning disable CS0612, CS0618

namespace System.Runtime.CompilerServices
{
    [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
    file sealed class InterceptsLocationAttribute : System.Attribute
    {
        public InterceptsLocationAttribute(int version, string data)
        {
        }
    }
}

namespace Microsoft.AspNetCore.OpenApi.Generated
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics.CodeAnalysis;
    using System.Globalization;
    using System.Linq;
    using System.Reflection;
    using System.Text;
    using System.Text.Json;
    using System.Text.Json.Nodes;
    using System.Threading;
    using System.Threading.Tasks;
    using Microsoft.AspNetCore.OpenApi;
    using Microsoft.AspNetCore.Mvc.Controllers;
    using Microsoft.AspNetCore.Mvc.ModelBinding.Metadata;
    using Microsoft.Extensions.DependencyInjection;
    using Microsoft.OpenApi;

    [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
    file record XmlComment(
        string? Summary,
        string? Description,
        string? Remarks,
        string? Returns,
        string? Value,
        bool Deprecated,
        List<string>? Examples,
        List<XmlParameterComment>? Parameters,
        List<XmlResponseComment>? Responses);

    [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
    file record XmlParameterComment(string? Name, string? Description, string? Example, bool Deprecated);

    [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
    file record XmlResponseComment(string Code, string? Description, string? Example);

    [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
    file static class XmlCommentCache
    {
        private static Dictionary<string, XmlComment>? _cache;
        public static Dictionary<string, XmlComment> Cache => _cache ??= GenerateCacheEntries();

        private static Dictionary<string, XmlComment> GenerateCacheEntries()
        {
            var cache = new Dictionary<string, XmlComment>();


            return cache;
        }
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
    file static class DocumentationCommentIdHelper
    {
        /// <summary>
        /// Generates a documentation comment

Check failure on line 1 in Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests.CompletenessTests.SupportsAllXmlTagsOnSchemas

See this annotation in the file changed.

@azure-pipelines azure-pipelines / aspnetcore-ci

Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests.CompletenessTests.SupportsAllXmlTagsOnSchemas

VerifyException : Directory: /datadisks/disk1/work/AC8E0989/w/B5490980/e/snapshots
NotEqual:
  - Received: CompletenessTests.SupportsAllXmlTagsOnSchemas#OpenApiXmlCommentSupport.generated.received.cs
    Verified: CompletenessTests.SupportsAllXmlTagsOnSchemas#OpenApiXmlCommentSupport.generated.verified.cs

FileContent:

NotEqual:

Received: CompletenessTests.SupportsAllXmlTagsOnSchemas#OpenApiXmlCommentSupport.generated.received.cs
//HintName: OpenApiXmlCommentSupport.generated.cs
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
// Suppress warnings about obsolete types and members
// in generated code
#pragma warning disable CS0612, CS0618

namespace System.Runtime.CompilerServices
{
    [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
    file sealed class InterceptsLocationAttribute : System.Attribute
    {
        public InterceptsLocationAttribute(int version, string data)
        {
        }
    }
}

namespace Microsoft.AspNetCore.OpenApi.Generated
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics.CodeAnalysis;
    using System.Globalization;
    using System.Linq;
    using System.Reflection;
    using System.Text;
    using System.Text.Json;
    using System.Text.Json.Nodes;
    using System.Threading;
    using System.Threading.Tasks;
    using Microsoft.AspNetCore.OpenApi;
    using Microsoft.AspNetCore.Mvc.Controllers;
    using Microsoft.AspNetCore.Mvc.ModelBinding.Metadata;
    using Microsoft.Extensions.DependencyInjection;
    using Microsoft.OpenApi;

    [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
    file record XmlComment(
        string? Summary,
        string? Description,
        string? Remarks,
        string? Returns,
        string? Value,
        bool Deprecated,
        List<string>? Examples,
        List<XmlParameterComment>? Parameters,
        List<XmlResponseComment>? Responses);

    [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
    file record XmlParameterComment(string? Name, string? Description, string? Example, bool Deprecated);

    [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
    file record XmlResponseComment(string Code, string? Description, string? Example);

    [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
    file static class XmlCommentCache
    {
        private static Dictionary<string, XmlComment>? _cache;
        public static Dictionary<string, XmlComment> Cache => _cache ??= GenerateCacheEntries();

        private static Dictionary<string, XmlComment> GenerateCacheEntries()
        {
            var cache = new Dictionary<string, XmlComment>();

            cache.Add(@"T:ExampleClass", new XmlComment(@"Every class and member should have a one sentence
summary describing its purpose.", null, @"     You can expand on that one sentence summary to
     provide more information for readers. In this case,
     the `ExampleClass` provides different C#
     elements to show how you 

Check failure on line 1 in Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests.OperationTests.SupportsXmlCommentsOnOperationsFromControllers

See this annotation in the file changed.

@azure-pipelines azure-pipelines / aspnetcore-ci

Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests.OperationTests.SupportsXmlCommentsOnOperationsFromControllers

VerifyException : Directory: /datadisks/disk1/work/AC8E0989/w/B5490980/e/snapshots
NotEqual:
  - Received: OperationTests.SupportsXmlCommentsOnOperationsFromControllers#OpenApiXmlCommentSupport.generated.received.cs
    Verified: OperationTests.SupportsXmlCommentsOnOperationsFromControllers#OpenApiXmlCommentSupport.generated.verified.cs

FileContent:

NotEqual:

Received: OperationTests.SupportsXmlCommentsOnOperationsFromControllers#OpenApiXmlCommentSupport.generated.received.cs
//HintName: OpenApiXmlCommentSupport.generated.cs
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
// Suppress warnings about obsolete types and members
// in generated code
#pragma warning disable CS0612, CS0618

namespace System.Runtime.CompilerServices
{
    [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
    file sealed class InterceptsLocationAttribute : System.Attribute
    {
        public InterceptsLocationAttribute(int version, string data)
        {
        }
    }
}

namespace Microsoft.AspNetCore.OpenApi.Generated
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics.CodeAnalysis;
    using System.Globalization;
    using System.Linq;
    using System.Reflection;
    using System.Text;
    using System.Text.Json;
    using System.Text.Json.Nodes;
    using System.Threading;
    using System.Threading.Tasks;
    using Microsoft.AspNetCore.OpenApi;
    using Microsoft.AspNetCore.Mvc.Controllers;
    using Microsoft.AspNetCore.Mvc.ModelBinding.Metadata;
    using Microsoft.Extensions.DependencyInjection;
    using Microsoft.OpenApi;

    [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
    file record XmlComment(
        string? Summary,
        string? Description,
        string? Remarks,
        string? Returns,
        string? Value,
        bool Deprecated,
        List<string>? Examples,
        List<XmlParameterComment>? Parameters,
        List<XmlResponseComment>? Responses);

    [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
    file record XmlParameterComment(string? Name, string? Description, string? Example, bool Deprecated);

    [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
    file record XmlResponseComment(string Code, string? Description, string? Example);

    [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
    file static class XmlCommentCache
    {
        private static Dictionary<string, XmlComment>? _cache;
        public static Dictionary<string, XmlComment> Cache => _cache ??= GenerateCacheEntries();

        private static Dictionary<string, XmlComment> GenerateCacheEntries()
        {
            var cache = new Dictionary<string, XmlComment>();

            cache.Add(@"M:TestController.Get", new XmlComment(@"A summary of the action.", @"A description of the action.", null, null, null, false, null, null, null));
            cache.Add(@"M:Test2Controller.Get(System.String)", new XmlComment(null, null, null, null, null, false, nul