File tree 2 files changed +6
-6
lines changed
Sources/SageSwiftKitMacros/CodableMacros/Builders
Tests/SageSwiftKitTests/CodableMacrosTests
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ struct DecodeVariableBuild {
186
186
}
187
187
188
188
func buildStringOrInt( attribute: AttributeSyntax ) -> CodeBlockItemSyntaxBuilder {
189
- guard type == " String " else {
189
+ guard type == " String? " else {
190
190
return buildBasicDecode ( )
191
191
}
192
192
@@ -221,7 +221,7 @@ struct DecodeVariableBuild {
221
221
}
222
222
223
223
func buildStringOrDouble( attribute: AttributeSyntax ) -> CodeBlockItemSyntaxBuilder {
224
- guard type == " String " else {
224
+ guard type == " String? " else {
225
225
return buildBasicDecode ( )
226
226
}
227
227
Original file line number Diff line number Diff line change @@ -136,12 +136,12 @@ final class CustomDecodableTests: XCTestCase {
136
136
@CustomCodable
137
137
struct PlayingObject {
138
138
@StringOrInt
139
- var value: String
139
+ var value: String?
140
140
}
141
141
""" ,
142
142
expandedSource: """
143
143
struct PlayingObject {
144
- var value: String
144
+ var value: String?
145
145
146
146
enum CodingKeys: String, CodingKey {
147
147
case value
@@ -180,12 +180,12 @@ final class CustomDecodableTests: XCTestCase {
180
180
@CustomCodable
181
181
struct PlayingObject {
182
182
@StringOrDouble
183
- var value: String
183
+ var value: String?
184
184
}
185
185
""" ,
186
186
expandedSource: """
187
187
struct PlayingObject {
188
- var value: String
188
+ var value: String?
189
189
190
190
enum CodingKeys: String, CodingKey {
191
191
case value
You can’t perform that action at this time.
0 commit comments