@@ -66,62 +66,62 @@ class UnionDecodeGeneratorTests {
6666 """
6767 extension MyUnion: Codable, Reflection {
6868 enum CodingKeys: String, CodingKey {
69- case blobValue
70- case booleanValue
71- case enumValue
72- case listValue
73- case mapValue
74- case numberValue
69+ case blobvalue = " blobValue"
70+ case booleanvalue = " booleanValue"
71+ case enumvalue = " enumValue"
72+ case listvalue = " listValue"
73+ case mapvalue = " mapValue"
74+ case numbervalue = " numberValue"
7575 case sdkUnknown
76- case stringValue
77- case structureValue
78- case timestampValue
76+ case stringvalue = " stringValue"
77+ case structurevalue = " structureValue"
78+ case timestampvalue = " timestampValue"
7979 }
8080
8181 public func encode(to encoder: Encoder) throws {
8282 var container = encoder.container(keyedBy: CodingKeys.self)
8383 switch self {
84- case let .blobValue(blobValue ):
85- if let blobValue = blobValue {
86- try container.encode(blobValue .base64EncodedString(), forKey: .blobValue )
84+ case let .blobvalue(blobvalue ):
85+ if let blobvalue = blobvalue {
86+ try container.encode(blobvalue .base64EncodedString(), forKey: .blobvalue )
8787 }
88- case let .booleanValue(booleanValue ):
89- if let booleanValue = booleanValue {
90- try container.encode(booleanValue , forKey: .booleanValue )
88+ case let .booleanvalue(booleanvalue ):
89+ if let booleanvalue = booleanvalue {
90+ try container.encode(booleanvalue , forKey: .booleanvalue )
9191 }
92- case let .enumValue(enumValue ):
93- if let enumValue = enumValue {
94- try container.encode(enumValue .rawValue, forKey: .enumValue )
92+ case let .enumvalue(enumvalue ):
93+ if let enumvalue = enumvalue {
94+ try container.encode(enumvalue .rawValue, forKey: .enumvalue )
9595 }
96- case let .listValue(listValue ):
97- if let listValue = listValue {
98- var listValueContainer = container.nestedUnkeyedContainer(forKey: .listValue )
99- for stringlist0 in listValue {
100- try listValueContainer .encode(stringlist0)
96+ case let .listvalue(listvalue ):
97+ if let listvalue = listvalue {
98+ var listvalueContainer = container.nestedUnkeyedContainer(forKey: .listvalue )
99+ for stringlist0 in listvalue {
100+ try listvalueContainer .encode(stringlist0)
101101 }
102102 }
103- case let .mapValue(mapValue ):
104- if let mapValue = mapValue {
105- var mapValueContainer = container.nestedContainer(keyedBy: Key.self, forKey: .mapValue )
106- for (dictKey0, stringmap0) in mapValue {
107- try mapValueContainer .encode(stringmap0, forKey: Key(stringValue: dictKey0))
103+ case let .mapvalue(mapvalue ):
104+ if let mapvalue = mapvalue {
105+ var mapvalueContainer = container.nestedContainer(keyedBy: Key.self, forKey: .mapvalue )
106+ for (dictKey0, stringmap0) in mapvalue {
107+ try mapvalueContainer .encode(stringmap0, forKey: Key(stringValue: dictKey0))
108108 }
109109 }
110- case let .numberValue(numberValue ):
111- if let numberValue = numberValue {
112- try container.encode(numberValue , forKey: .numberValue )
110+ case let .numbervalue(numbervalue ):
111+ if let numbervalue = numbervalue {
112+ try container.encode(numbervalue , forKey: .numbervalue )
113113 }
114- case let .stringValue(stringValue ):
115- if let stringValue = stringValue {
116- try container.encode(stringValue , forKey: .stringValue )
114+ case let .stringvalue(stringvalue ):
115+ if let stringvalue = stringvalue {
116+ try container.encode(stringvalue , forKey: .stringvalue )
117117 }
118- case let .structureValue(structureValue ):
119- if let structureValue = structureValue {
120- try container.encode(structureValue , forKey: .structureValue )
118+ case let .structurevalue(structurevalue ):
119+ if let structurevalue = structurevalue {
120+ try container.encode(structurevalue , forKey: .structurevalue )
121121 }
122- case let .timestampValue(timestampValue ):
123- if let timestampValue = timestampValue {
124- try container.encode(timestampValue .iso8601WithoutFractionalSeconds(), forKey: .timestampValue )
122+ case let .timestampvalue(timestampvalue ):
123+ if let timestampvalue = timestampvalue {
124+ try container.encode(timestampvalue .iso8601WithoutFractionalSeconds(), forKey: .timestampvalue )
125125 }
126126 case let .sdkUnknown(sdkUnknown):
127127 try container.encode(sdkUnknown, forKey: .sdkUnknown)
@@ -130,72 +130,72 @@ class UnionDecodeGeneratorTests {
130130
131131 public init (from decoder: Decoder) throws {
132132 let values = try decoder.container(keyedBy: CodingKeys.self)
133- let stringValueDecoded = try values.decodeIfPresent(String.self, forKey: .stringValue )
134- if let stringValue = stringValueDecoded {
135- self = .stringValue(stringValue )
133+ let stringvalueDecoded = try values.decodeIfPresent(String.self, forKey: .stringvalue )
134+ if let stringvalue = stringvalueDecoded {
135+ self = .stringvalue(stringvalue )
136136 return
137137 }
138- let booleanValueDecoded = try values.decodeIfPresent(Bool.self, forKey: .booleanValue )
139- if let booleanValue = booleanValueDecoded {
140- self = .booleanValue(booleanValue )
138+ let booleanvalueDecoded = try values.decodeIfPresent(Bool.self, forKey: .booleanvalue )
139+ if let booleanvalue = booleanvalueDecoded {
140+ self = .booleanvalue(booleanvalue )
141141 return
142142 }
143- let numberValueDecoded = try values.decodeIfPresent(Int.self, forKey: .numberValue )
144- if let numberValue = numberValueDecoded {
145- self = .numberValue(numberValue )
143+ let numbervalueDecoded = try values.decodeIfPresent(Int.self, forKey: .numbervalue )
144+ if let numbervalue = numbervalueDecoded {
145+ self = .numbervalue(numbervalue )
146146 return
147147 }
148- let blobValueDecoded = try values.decodeIfPresent(Data.self, forKey: .blobValue )
149- if let blobValue = blobValueDecoded {
150- self = .blobValue(blobValue )
148+ let blobvalueDecoded = try values.decodeIfPresent(Data.self, forKey: .blobvalue )
149+ if let blobvalue = blobvalueDecoded {
150+ self = .blobvalue(blobvalue )
151151 return
152152 }
153- let timestampValueDateString = try values.decodeIfPresent(String.self, forKey: .timestampValue )
154- var timestampValueDecoded : Date? = nil
155- if let timestampValueDateString = timestampValueDateString {
156- let timestampValueFormatter = DateFormatter.iso8601DateFormatterWithoutFractionalSeconds
157- timestampValueDecoded = timestampValueFormatter .date(from: timestampValueDateString )
153+ let timestampvalueDateString = try values.decodeIfPresent(String.self, forKey: .timestampvalue )
154+ var timestampvalueDecoded : Date? = nil
155+ if let timestampvalueDateString = timestampvalueDateString {
156+ let timestampvalueFormatter = DateFormatter.iso8601DateFormatterWithoutFractionalSeconds
157+ timestampvalueDecoded = timestampvalueFormatter .date(from: timestampvalueDateString )
158158 }
159- if let timestampValue = timestampValueDecoded {
160- self = .timestampValue(timestampValue )
159+ if let timestampvalue = timestampvalueDecoded {
160+ self = .timestampvalue(timestampvalue )
161161 return
162162 }
163- let enumValueDecoded = try values.decodeIfPresent(FooEnum.self, forKey: .enumValue )
164- if let enumValue = enumValueDecoded {
165- self = .enumValue(enumValue )
163+ let enumvalueDecoded = try values.decodeIfPresent(FooEnum.self, forKey: .enumvalue )
164+ if let enumvalue = enumvalueDecoded {
165+ self = .enumvalue(enumvalue )
166166 return
167167 }
168- let listValueContainer = try values.decodeIfPresent([String?].self, forKey: .listValue )
169- var listValueDecoded0 :[String]? = nil
170- if let listValueContainer = listValueContainer {
171- listValueDecoded0 = [String]()
172- for string0 in listValueContainer {
168+ let listvalueContainer = try values.decodeIfPresent([String?].self, forKey: .listvalue )
169+ var listvalueDecoded0 :[String]? = nil
170+ if let listvalueContainer = listvalueContainer {
171+ listvalueDecoded0 = [String]()
172+ for string0 in listvalueContainer {
173173 if let string0 = string0 {
174- listValueDecoded0 ?.append(string0)
174+ listvalueDecoded0 ?.append(string0)
175175 }
176176 }
177177 }
178- if let listValue = listValueDecoded0 {
179- self = .listValue(listValue )
178+ if let listvalue = listvalueDecoded0 {
179+ self = .listvalue(listvalue )
180180 return
181181 }
182- let mapValueContainer = try values.decodeIfPresent([String: String?].self, forKey: .mapValue )
183- var mapValueDecoded0 : [String:String]? = nil
184- if let mapValueContainer = mapValueContainer {
185- mapValueDecoded0 = [String:String]()
186- for (key0, string0) in mapValueContainer {
182+ let mapvalueContainer = try values.decodeIfPresent([String: String?].self, forKey: .mapvalue )
183+ var mapvalueDecoded0 : [String:String]? = nil
184+ if let mapvalueContainer = mapvalueContainer {
185+ mapvalueDecoded0 = [String:String]()
186+ for (key0, string0) in mapvalueContainer {
187187 if let string0 = string0 {
188- mapValueDecoded0 ?[key0] = string0
188+ mapvalueDecoded0 ?[key0] = string0
189189 }
190190 }
191191 }
192- if let mapValue = mapValueDecoded0 {
193- self = .mapValue(mapValue )
192+ if let mapvalue = mapvalueDecoded0 {
193+ self = .mapvalue(mapvalue )
194194 return
195195 }
196- let structureValueDecoded = try values.decodeIfPresent(GreetingWithErrorsOutput.self, forKey: .structureValue )
197- if let structureValue = structureValueDecoded {
198- self = .structureValue(structureValue )
196+ let structurevalueDecoded = try values.decodeIfPresent(GreetingWithErrorsOutput.self, forKey: .structurevalue )
197+ if let structurevalue = structurevalueDecoded {
198+ self = .structurevalue(structurevalue )
199199 return
200200 }
201201 self = .sdkUnknown("")
0 commit comments