Skip to content

Commit

Permalink
upgrade spec package and simplify code (#836)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdghchj committed Dec 4, 2020
1 parent 62e4d9b commit 88888c5
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions operation.go
Expand Up @@ -11,7 +11,6 @@ import (
"os"
"path/filepath"
"regexp"
"sort"
"strconv"
"strings"

Expand Down Expand Up @@ -247,14 +246,7 @@ func (operation *Operation) ParseParamComment(commentLine string, astFile *ast.F
}
return false
}
items := make(spec.OrderSchemaItems, 0, len(schema.Properties))
for k, v := range schema.Properties {
items = append(items, spec.OrderSchemaItem{
Name: k,
Schema: v,
})
}
sort.Sort(items)
items := schema.Properties.ToOrderedSchemaItems()
for _, item := range items {
name := item.Name
prop := item.Schema
Expand Down

0 comments on commit 88888c5

Please sign in to comment.