-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
The new OpenAPI support for ASP.NET Core projects generates semantic errors for some types, specifically for $ref entries. The sample below reproduces the issue: one of the properties gets the following ref: "$ref" "#/components/schemas/#/properties/locaisRemover/items/properties/locais" which produces invalid description.
Expected Behavior
No response
Steps To Reproduce
Here's a sample that reproduces the issue by using and :
using Microsoft.AspNetCore.Http.HttpResults;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
builder.Services.AddOpenApi( );
var app = builder.Build( );
// Configure the HTTP request pipeline.
if( app.Environment.IsDevelopment( ) ) {
app.MapOpenApi( );
}
app.UseHttpsRedirection( );
app.MapPut("/test",
(MsgMovimentacaoLocaisTrabalho msg) => Results.Ok( ))
.WithName("GetWeatherForecast");
app.Run( );
public class MsgMovimentacaoLocaisTrabalho {
public IList<InfoGeral>? LocaisRemover { get; set; }
public InfoGeral? LocaisAssociar { get; set; }
}
public class InfoGeral {
public Guid GuidDirecao { get; set; }
public IEnumerable<int> Locais { get; set; } = Enumerable.Empty<int>();
}
Exceptions (if any)
No response
.NET Version
9.0.101
Anything else?
No response
Metadata
Metadata
Assignees
Labels
area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi