Simplify.Web.Swagger
is a package which provides Swagger generation for Simplify.Web web-framework controllers.
- Add
Simplify.Web.Swagger
,Swashbuckle.AspNetCore.SwaggerGen
andSwashbuckle.AspNetCore.SwaggerUI
packages to your project
<PackageReference Include="Simplify.Web.Swagger" Version="1.0.*" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.6.*" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.6.*" />
- Add
AddSimplifyWebSwagger
inAddSwaggerGen
registration andSimplify.Web
controllers will be scanned during Swagger generation process.
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddEndpointsApiExplorer()
.AddSwaggerGen(x => x.AddSimplifyWebSwagger());
- Use Swagger as in regular ASP.NET Core project
var app = builder.Build();
app.UseSwagger();
app.UseSwaggerUI();
app.UseSimplifyWeb();
await app.RunAsync();
- Add controller Swagger attributes (if needed)
[Get("/api/v1/users/{id}")]
[ApiVersion("1.0")]
[ProducesResponse(StatusCodes.Status200OK, "application/json")]
[ProducesResponse(StatusCodes.Status500InternalServerError)]
public class GetController : Controller2
{
...
}
- After application started go to http://localhost:5000/swagger/index.html or http://localhost:5000/swagger/v1/swagger.json to see generated Swagger
Below is the example of Swagger generated by Simplify.Web.Swagger
:
There are many ways in which you can participate in the project. Like most open-source software projects, contributing code is just one of many outlets where you can help improve. Some of the things that you could help out with are:
- Documentation (both code and features)
- Bug reports
- Bug fixes
- Feature requests
- Feature implementations
- Test coverage
- Code quality
- Sample applications
Additional extensions to Simplify.Web live in their own repositories on GitHub. For example:
- Simplify.Web.Json - JSON serialization/deserialization
- Simplify.Web.Postman - Postman collection and environment generation
- Simplify.Web.Multipart - multipart form model binder
- Simplify.Web.MessageBox - non-interactive server side message box
- Simplify.Web.Templates - .NET projects templates
Licensed under the GNU LESSER GENERAL PUBLIC LICENSE