Skip to content

Commit 532bc2f

Browse files
authored
Add missed condition to encoding
1 parent dd50f85 commit 532bc2f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/_OpenAPIGeneratorCore/Extensions/String.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ fileprivate extension String {
8282
outScalar = scalar
8383
} else {
8484
var hexString = String(scalar.value, radix: 16, uppercase: true)
85-
if let firstChar = hexString.unicodeScalars.first,
85+
if index == 0,
86+
let firstChar = hexString.unicodeScalars.first,
8687
!firstCharSet.contains(firstChar) {
8788
hexString = "_\(hexString)"
8889
}

0 commit comments

Comments
 (0)