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>

--

--

--

Computer Engineer, Software Developer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Day 22 of 30-Day LeetCode Challenge

Hello, Dolly: Animating Cinemachine Virtual Cameras on the Dolly Track

Joystream. About the roles in the project and who you can become.

Floating Label Experiment

TPM Stories: Simon Karpen from DoorDash

DrPsychick On The Web

MY ACHIEVABLE AIMS AND GOALS FOR THE INTERNSHIP

API automation with REST Assured

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
Taşkın Binbir

Taşkın Binbir

Computer Engineer, Software Developer

More from Medium

Implement AppMetrics .NET 6

Difference between AddScoped and AddTransient in .NET 6

Create NuGet Package with .NET

Load and stress testing in .NET 6