-
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 etcbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.feature-minimal-actionsController-like actions for endpoint routingController-like actions for endpoint routing
Milestone
Description
Describe the bug
Services injected into Map overloads get detected as models in the open api description.
To Reproduce
using Microsoft.OpenApi.Models;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new OpenApiInfo { Title = builder.Environment.ApplicationName, Version = "v1" });
});
var app = builder.Build();
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", $"{builder.Environment.ApplicationName} v1"));
}
app.MapGet("/todos", (MyService service) =>
{
});
app.Run();
class MyService
{
}
The above URL shows up like this in the swagger UI:
Further technical details
- Microsoft.NETCore.App 6.0.0-preview.6.21317.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
cc @halter73
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 etcbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.feature-minimal-actionsController-like actions for endpoint routingController-like actions for endpoint routing