File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ func main() {
2424 apiSetExternalDocs (& apiDoc )
2525 apiSetComponents (& apiDoc )
2626
27- apiDoc .AddRoute (docs.Path {
27+ apiDoc .AddRoute (& docs.Path {
2828 Route : "/users" ,
2929 HTTPMethod : "POST" ,
3030 OperationID : "createUser" ,
@@ -43,7 +43,7 @@ func main() {
4343 },
4444 })
4545
46- apiDoc .AddRoute (docs.Path {
46+ apiDoc .AddRoute (& docs.Path {
4747 Route : "/users" ,
4848 HTTPMethod : "GET" ,
4949 OperationID : "getUser" ,
Original file line number Diff line number Diff line change @@ -40,6 +40,6 @@ func (oas *OAS) GetPathByIndex(index int) *Path {
4040}
4141
4242// AddRoute is used for add API documentation routes.
43- func (oas * OAS ) AddRoute (path Path ) {
44- oas .Paths = append (oas .Paths , path )
43+ func (oas * OAS ) AddRoute (path * Path ) {
44+ oas .Paths = append (oas .Paths , * path )
4545}
Original file line number Diff line number Diff line change @@ -305,19 +305,19 @@ func TestOAS_AddRoute(t *testing.T) {
305305 tests := []struct {
306306 name string
307307 oas * OAS
308- path Path
308+ path * Path
309309 wantPaths Paths
310310 }{
311311 {
312312 name : "success-no-existing-paths" ,
313313 oas : & OAS {},
314- path : pathGetUser ,
314+ path : & pathGetUser ,
315315 wantPaths : Paths {pathGetUser },
316316 },
317317 {
318318 name : "success-existing-paths" ,
319319 oas : & OAS {Paths : Paths {pathGetUser }},
320- path : pathCreateUser ,
320+ path : & pathCreateUser ,
321321 wantPaths : Paths {pathGetUser , pathCreateUser },
322322 },
323323 }
You can’t perform that action at this time.
0 commit comments