Skip to content

Properties with the [Required] attribute should be required in the generated OpenAPI document #56212

@mikekistler

Description

@mikekistler

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

A property of a class or record that has the [Required] attribute is currently not a required property of the schema produced by the .NET 9 OpenAPI document generation feature.

Expected Behavior

A property with the [Required] attribute should be a required property of the OpenAPI schema.

Steps To Reproduce

Not minimal, but there is a recreate in the "Schemas" section of my aspnet-openapi-examples project.

Exceptions (if any)

No response

.NET Version

9.0-preview4

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesfeature-openapi

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions