Skip to content

Properties with the [DefaultValue] attribute should have a default value in the generated OpenAPI document #56215

@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 [DefaultValue] attribute currently does not have a default in the schema produced by the .NET 9 OpenAPI document generation feature.

Expected Behavior

A property with the [DefaultValue] attribute should have a default with the value specified in the generated 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