Skip to content

Commit

Permalink
refactor: sort enum values for consistency (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
byashimov authored Jan 28, 2025
1 parent 84e342b commit 2aae781
Show file tree
Hide file tree
Showing 22 changed files with 278 additions and 273 deletions.
5 changes: 5 additions & 0 deletions generator/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ func (s *Schema) init(doc *Doc, scope map[string]*Schema, name string) {
if !strings.Contains(s.CamelName, enumTypeSuffix) {
s.CamelName += enumTypeSuffix
}

// Sorts values for consistency
sort.Slice(s.Enum, func(i, j int) bool {
return fmt.Sprint(s.Enum[i]) < fmt.Sprint(s.Enum[j])
})
}

// Adds suffix to reduce name collision
Expand Down
42 changes: 21 additions & 21 deletions handler/account/account.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions handler/accountauthentication/accountauthentication.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 18 additions & 18 deletions handler/accountteam/accountteam.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions handler/billinggroup/billinggroup.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions handler/clickhouse/clickhouse.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions handler/flinkapplication/flinkapplication.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2aae781

Please sign in to comment.