Extended Swagger in .net core 6

[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(WeatherForecast[]))][ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(BadRequestModel))]
/// <summary>/// Return Whole Weather Forecasts/// </summary>
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>
<Project Sdk="Microsoft.NET.Sdk.Web"><PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
</ItemGroup>
</Project>
//using System.Reflection;builder.Services.AddSwaggerGen(options =>{var xmlFilename = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";options.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, xmlFilename));});
/// <remarks>///  This api just get to whole **Weather Forecasts**/// </remarks>
/// <response code="200">Get Weather Forecast</response>/// <response code="400">Bad Request For Weather Forecast</response>

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store