Skip to content

Commit a52a03b

Browse files
authored
Update README.md
1 parent 1ad84f7 commit a52a03b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ endpoints := []Endpoint{
218218
EndPoint(GET, "/product", "product", Params(IntParam("id", true, "")), nil, models.Product{}, models.ErrorResponse{}, ""),
219219
EndPoint(POST, "/product", "product", Params(), models.ProductPost{}, models.Product{}, models.ErrorResponse{}, ""),
220220
}
221+
// add endpoints array to Swagno
222+
AddEndpoints(endpoints)
221223
```
222224

223225
- Arguments: (Method, Path, Tag, Params, Body, Response, Error Response, Description)
@@ -230,6 +232,8 @@ endpoints := []swagno.Endpoint{
230232
swagno.EndPoint(swagno.GET, "/product", "product", swagno.Params(swagno.IntParam("id", true, "")), nil, models.Product{}, models.ErrorResponse{}, ""),
231233
swagno.EndPoint(swagno.POST, "/product", "product", swagno.Params(), models.ProductPost{}, models.Product{}, models.ErrorResponse{}, ""),
232234
}
235+
// add endpoints array to Swagno
236+
swagno.AddEndpoints(endpoints)
233237
```
234238

235239
If you don't like this functional approach, you can use directly struct:
@@ -240,6 +244,11 @@ endpoints := []Endpoint{
240244
}
241245
```
242246

247+
**Don't forget to add your endpoints array to Swagno**
248+
```go
249+
AddEndpoints(endpoints)
250+
```
251+
243252
### Method
244253

245254
Options: GET, POST, PUT, DELETE, OPTION, PATCH, HEAD

0 commit comments

Comments
 (0)