Skip to content

Commit

Permalink
refactor: sort enum values for consistency (#238)
Browse files Browse the repository at this point in the history
byashimov authored Jan 28, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 84e342b commit 2aae781
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
@@ -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
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.

52 changes: 26 additions & 26 deletions handler/flinkapplicationdeployment/flinkapplicationdeployment.go
30 changes: 15 additions & 15 deletions handler/flinkjarapplication/flinkjarapplication.go
28 changes: 14 additions & 14 deletions handler/flinkjob/flinkjob.go
24 changes: 12 additions & 12 deletions handler/kafkaconnect/kafkaconnect.go
38 changes: 19 additions & 19 deletions handler/kafkatopic/kafkatopic.go
18 changes: 9 additions & 9 deletions handler/opensearch/opensearch.go
4 changes: 2 additions & 2 deletions handler/organization/organization.go
4 changes: 2 additions & 2 deletions handler/postgresql/postgresql.go
38 changes: 19 additions & 19 deletions handler/privatelink/privatelink.go
6 changes: 3 additions & 3 deletions handler/projectbilling/projectbilling.go
74 changes: 37 additions & 37 deletions handler/service/service.go
50 changes: 25 additions & 25 deletions handler/staticip/staticip.go
4 changes: 2 additions & 2 deletions handler/user/user.go

0 comments on commit 2aae781

Please sign in to comment.