Skip to content

OpenApi Json schema is incorrect in Dotnet version 9.0.4 #61717

@itroncolinis

Description

@itroncolinis

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Even if Dotnet version 9.0.4 is supposed to fix #60339, a minimal model in the repro project emits wrong Json shema

Expected Behavior

In the repro project, I expect the correct Json schema to be created at https://localhost:7295/openapi/v1.json

Image

but the wrong schema is created:

Image

If you uncomment the code in Program.cs lines 11-14, a schema transformer is applied and the correct schema is generated.

Steps To Reproduce

Clone repro solution at

https://github.com/itroncolinis/openapibug

Launch the application and verify the json schema at https://localhost:7295/openapi/v1.json

Exceptions (if any)

No response

.NET Version

9.0.203

Anything else?

My IDE is Visual Studio 2022 (Version 17.13.6)

dotnet--info-output.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions