Skip to content

Commit 243dcba

Browse files
committed
[add] initial Readme
1 parent 5b6dbf1 commit 243dcba

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

README.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Simplify.Web.Swagger
2+
3+
[![Nuget Version](https://img.shields.io/nuget/v/Simplify.Web.Swagger)](https://www.nuget.org/packages/Simplify.Web.Swagger/)
4+
[![Nuget Download](https://img.shields.io/nuget/dt/Simplify.Web.Swagger)](https://www.nuget.org/packages/Simplify.Web.Swagger/)
5+
[![Build Package](https://github.com/SimplifyNet/Simplify.Web.Swagger/actions/workflows/build.yml/badge.svg)](https://github.com/SimplifyNet/Simplify.Web.Swagger/actions/workflows/build.yml)[![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/nuget/Simplify.Web.Swagger)](https://libraries.io/nuget/Simplify.Web.Swagger)
6+
[![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/SimplifyNet/Simplify.Web.Swagger)](https://www.codefactor.io/repository/github/simplifynet/Simplify.Web.Swagger)
7+
![Platform](https://img.shields.io/badge/platform-.NET%206.0%20%7C%20.NET%20Standard%202.0-lightgrey)
8+
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen)](http://makeapullrequest.com)
9+
10+
`Simplify.Web.Swagger` is a package which provides Swagger generation for [Simplify.Web](https://github.com/SimplifyNet/Simplify.Web) web-framework controllers.
11+
12+
## Quick Start
13+
14+
1. Add `Swashbuckle.AspNetCore.SwaggerGen` and `Swashbuckle.AspNetCore.SwaggerUI` packages to your project
15+
16+
1. Add `AddSimplifyWebSwagger` in `AddSwaggerGen` registration and `Simplify.Web` controllers will be scanned when generation Swagger.
17+
18+
```csharp
19+
var builder = WebApplication.CreateBuilder(args);
20+
21+
builder.Services.AddEndpointsApiExplorer()
22+
.AddSwaggerGen(x => x.AddSimplifyWebSwagger());
23+
```
24+
25+
3. Use swagger as in regular ASP.NET Core project
26+
27+
```csharp
28+
var app = builder.Build();
29+
30+
app.UseSwagger();
31+
app.UseSwaggerUI();
32+
33+
app.UseSimplifyWebWithoutRegistrations();
34+
35+
app.Run();
36+
```
37+
38+
4. Add controller Swagger attributes (if needed)
39+
40+
```csharp
41+
[Get("/api/v1/users/{id:int}")]
42+
[ApiVersion("1.0")]
43+
[ProducesResponse(StatusCodes.Status200OK, "application/json")]
44+
[ProducesResponse(StatusCodes.Status500InternalServerError)]
45+
public class GetController : Simplify.Web.Controller
46+
{
47+
...
48+
}
49+
```
50+
51+
5. After application started go to <http://localhost:5000/swagger/index.html> or <http://localhost:5000/swagger/swagger.json> to see generated Swagger
52+
53+
## Contributing
54+
55+
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:
56+
57+
- Documentation (both code and features)
58+
- Bug reports
59+
- Bug fixes
60+
- Feature requests
61+
- Feature implementations
62+
- Test coverage
63+
- Code quality
64+
- Sample applications
65+
66+
## Related Projects
67+
68+
Additional extensions to Simplify.Web live in their own repositories on GitHub. For example:
69+
70+
- [Simplify.Web.Json](https://github.com/SimplifyNet/Simplify.Web.Json) - JSON serialization/deserialization
71+
- [Simplify.Web.Multipart](https://github.com/SimplifyNet/Simplify.Web.Multipart) - multipart form model binder
72+
- [Simplify.Web.MessageBox](https://github.com/SimplifyNet/Simplify.Web.MessageBox) - non-interactive server side message box
73+
- [Simplify.Web.Templates](https://github.com/SimplifyNet/Simplify.Web.Templates) - Visual studio project templates
74+
75+
## License
76+
77+
Licensed under the GNU LESSER GENERAL PUBLIC LICENSE

0 commit comments

Comments
 (0)