Skip to content

[OpenApi] FromForm parameters with [Description] Attribute not include the description text #62514

Open
@MalvinJu

Description

@MalvinJu

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When there's [FromForm] presents as the parameter on the endpoint and you have [Description] attribute on the request model. The description is not included in the generated OpenApi doc.

Expected Behavior

The description tag is also included.

Steps To Reproduce

// Request model
public class Testing
{
    [Description("Testing purpose")]
    public string Description { get; set; }
}

// The endpoint
public async Task<IActionResult> GetOrganisationInfoAsync([FromForm] Testing testing)
{
    return Ok();
}

Result in openApi doc, no description is generated.

"schema": { "type": "object", "properties": { "testing": { "type": "string" }, ....

Exceptions (if any)

No response

.NET Version

9.0.102

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesfeature-openapi

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions