We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3aaabd7 commit a2407d9Copy full SHA for a2407d9
Sources/_OpenAPIGeneratorCore/Translator/CommonTranslations/translateRawEnum.swift
@@ -100,7 +100,9 @@ extension FileTranslator {
100
// In nullable enum schemas, empty strings are parsed as Void.
101
// This is unlikely to be fixed, so handling that case here.
102
// https://github.com/apple/swift-openapi-generator/issues/118
103
- if isNullable && anyValue is Void {
+ // Also handle nil values in nullable schemas.
104
+ let isNullValue = anyValue is Void || (anyValue as? String) == nil
105
+ if isNullable && isNullValue {
106
try addIfUnique(id: .string(""), caseName: context.safeNameGenerator.swiftMemberName(for: ""))
107
} else {
108
guard let rawValue = anyValue as? String else {
0 commit comments