Skip to content

Commit

Permalink
fix: percent in enum values (#664)
Browse files Browse the repository at this point in the history
Closes: #661
  • Loading branch information
corani committed Jul 25, 2022
1 parent f6cb4a8 commit 00a095c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/test/components/components.gen.go

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

1 change: 1 addition & 0 deletions internal/test/components/components.yaml
Expand Up @@ -429,6 +429,7 @@ components:
- '*'
- '5'
- '&'
- '%'
- ''
RenameMe:
description: This schema should be renamed via x-go-name when generating
Expand Down
2 changes: 2 additions & 0 deletions pkg/codegen/utils.go
Expand Up @@ -604,6 +604,8 @@ func typeNamePrefix(name string) (prefix string) {
prefix += "Asterisk"
case '^':
prefix += "Caret"
case '%':
prefix += "Percent"
default:
// Prepend "N" to schemas starting with a number
if prefix == "" && unicode.IsDigit(r) {
Expand Down

0 comments on commit 00a095c

Please sign in to comment.