Skip to content

Commit 88888c5

Browse files
authored
upgrade spec package and simplify code (#836)
1 parent 62e4d9b commit 88888c5

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

operation.go

+1-9
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"os"
1212
"path/filepath"
1313
"regexp"
14-
"sort"
1514
"strconv"
1615
"strings"
1716

@@ -247,14 +246,7 @@ func (operation *Operation) ParseParamComment(commentLine string, astFile *ast.F
247246
}
248247
return false
249248
}
250-
items := make(spec.OrderSchemaItems, 0, len(schema.Properties))
251-
for k, v := range schema.Properties {
252-
items = append(items, spec.OrderSchemaItem{
253-
Name: k,
254-
Schema: v,
255-
})
256-
}
257-
sort.Sort(items)
249+
items := schema.Properties.ToOrderedSchemaItems()
258250
for _, item := range items {
259251
name := item.Name
260252
prop := item.Schema

0 commit comments

Comments
 (0)