swagger-ui icon indicating copy to clipboard operation
swagger-ui copied to clipboard

Methods request schema dropbox has no type name when using UseAllOfToExtendReferenceSchemas

Open bampo opened this issue 5 years ago • 1 comments

Q&A (please complete the following information)

  • Browser: Chrome
  • Version: 94
  • Swagger-UI version: 6.22
  • Swagger/OpenAPI version: 6.2.2

Content & configuration

Create default ASP NET Core 3.1 WebAPI weatheforecast project. with ConfigureServices() ... services.AddSwaggerGen(c => { c.UseAllOfToExtendReferenceSchemas(); });

and Configure() ... app.UseSwagger(); app.UseSwaggerUI();

Add POST method to WeatherForecastController [HttpPost] public WeatherForecast Post(WeatherForecast req) { return new WeatherForecast(); } Start APP and go to swagger page.

Steps to reproduce the behavior:

  1. Expand POST method
  2. Click on "Schema"
  3. Expect to be "WeatherForecast >" dropbox, but it is only ">"

In Responses.Schema dropbox is correct, with typename before arrow.

bampo avatar Oct 01 '21 14:10 bampo

UseAllOfToExtendReferenceSchemas is a Swashbuckle config. Open an issue with Swashbuckle here:

https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues

hkosova avatar Nov 01 '21 16:11 hkosova