File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed
tools/cli/internal/openapi Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ package openapi
1616
1717import (
1818 "log"
19- "sort "
19+ "slices "
2020 "strings"
2121
2222 "github.com/getkin/kin-openapi/openapi3"
@@ -234,7 +234,9 @@ func (o OasDiff) mergeTags() error {
234234 }
235235 }
236236 }
237- sort .Sort (ByName (baseTags ))
237+ slices .SortFunc (ByName (baseTags ), func (a , b * openapi3.Tag ) int {
238+ return strings .Compare (strings .ToLower (a .Name ), strings .ToLower (b .Name ))
239+ })
238240 o .base .Spec .Tags = baseTags
239241 return nil
240242}
Original file line number Diff line number Diff line change @@ -174,13 +174,13 @@ func TestOasDiff_mergeTags(t *testing.T) {
174174 Spec : & openapi3.T {
175175 Tags : []* openapi3.Tag {
176176 {
177- Name : "Tag1 " ,
178- Description : "Tag1 " ,
177+ Name : "AWS Clusters DNS " ,
178+ Description : "AWS Clusters DNS " ,
179179 },
180180
181181 {
182- Name : "Tag2 " ,
183- Description : "Tag2 " ,
182+ Name : "Access Tracking " ,
183+ Description : "Access Tracking " ,
184184 },
185185 },
186186 },
@@ -189,13 +189,13 @@ func TestOasDiff_mergeTags(t *testing.T) {
189189 wantErr : require .NoError ,
190190 expectedTags : []* openapi3.Tag {
191191 {
192- Name : "Tag1 " ,
193- Description : "Tag1 " ,
192+ Name : "Access Tracking " ,
193+ Description : "Access Tracking " ,
194194 },
195195
196196 {
197- Name : "Tag2 " ,
198- Description : "Tag2 " ,
197+ Name : "AWS Clusters DNS " ,
198+ Description : "AWS Clusters DNS " ,
199199 },
200200 {
201201 Name : "TagBase1" ,
You can’t perform that action at this time.
0 commit comments