Skip to content

Commit 478a61b

Browse files
committed
streamline: openapi3edit: update OperationMore.Path
1 parent 9a450a3 commit 478a61b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

openapi3edit/operations.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ import (
99
"github.com/grokify/swaggman/openapi3"
1010
)
1111

12+
// OperationMore is used frow two purposes: (a) to store path and method information with the operation and
13+
// (b) to provide a container to organize operation related functions.
1214
type OperationMore struct {
13-
UrlPath string
15+
Path string
1416
Method string
1517
Operation *oas3.Operation
1618
}
@@ -259,15 +261,15 @@ func QueryOperationsByTags(spec *oas3.Swagger, tags []string) *OperationMoreSet
259261
}
260262
opmSet := &OperationMoreSet{OperationMores: []OperationMore{}}
261263
// for path, pathInfo := range spec.Paths {
262-
openapi3.VisitOperations(spec, func(url, method string, op *oas3.Operation) {
264+
openapi3.VisitOperations(spec, func(path, method string, op *oas3.Operation) {
263265
if op == nil {
264266
return
265267
}
266268
for _, tagTry := range op.Tags {
267269
if _, ok := tagsWantMatch[tagTry]; ok {
268270
opmSet.OperationMores = append(opmSet.OperationMores,
269271
OperationMore{
270-
UrlPath: url,
272+
Path: path,
271273
Method: method,
272274
Operation: op})
273275
return

0 commit comments

Comments
 (0)