Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The .NET OpenAPI generator is creating duplicate models when generating from a minimal API setup in .NET 9. #1934

Closed
jzs11 opened this issue Nov 15, 2024 · 4 comments

Comments

@jzs11
Copy link

jzs11 commented Nov 15, 2024

Describe the bug
The .NET OpenAPI generator is creating duplicate models when generating from a minimal API setup in .NET 9.

OpenApi File To Reproduce
Steps to reproduce:

  • Create a .NET 9 minimal API project
  • Generate OpenAPI specification using the built-in tools
  • Observe the generated output contains duplicate entries

Expected behavior
The OpenAPI generator should create unique model without any duplication, properly reflecting the minimal API structure.

Screenshots/Code Snippets
Sample1
Image

Sample2
Image

And few others.

@jzs11 jzs11 changed the title The .NET OpenAPI generator is creating duplicate code/endpoints when generating from a minimal API setup in .NET 9. The .NET OpenAPI generator is creating duplicate models when generating from a minimal API setup in .NET 9. Nov 15, 2024
@captainsafia
Copy link
Member

@jzs11 This repo is for the underlying data model used by ASP.NET Core. I'd recommend that you file this bug on the dotnet/aspnetcore repo for further investigation.

@ricardoboss
Copy link

For anyone stumbling on this issue (like I did), someone already reported this to the ASP.NET team: dotnet/aspnetcore#58968

@akamor
Copy link

akamor commented Jan 3, 2025

@captainsafia Given your contributions on the openapi work for dotnet9 is this something you can help raise awareness of? As things currently stand, I dont see how the openapi work in dotnet 9 is useable at all for anything but very trivial schemas.

@captainsafia
Copy link
Member

@akamor Yep, this is on my radar. Doing some investigation into the various reports at the moment. I'll post in the issue referenced in this comment once I have something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants