Skip to content

Commit e89b580

Browse files
committed
Allow optional (nil) SKU for order line item
1 parent be477ee commit e89b580

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Networking/Networking/Model/OrderItem.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public struct OrderItem: Codable, Equatable, Hashable, GeneratedFakeable, Genera
9292
// some plugins alter the field value from String to Int or Decimal.
9393
let sku = container.failsafeDecodeIfPresent(targetType: String.self,
9494
forKey: .sku,
95-
alternativeTypes: [.decimal(transform: { NSDecimalNumber(decimal: $0).stringValue })]) ?? ""
95+
alternativeTypes: [.decimal(transform: { NSDecimalNumber(decimal: $0).stringValue })])
9696
let subtotal = try container.decode(String.self, forKey: .subtotal)
9797
let subtotalTax = try container.decode(String.self, forKey: .subtotalTax)
9898
let taxClass = try container.decode(String.self, forKey: .taxClass)

Networking/NetworkingTests/Responses/product-alternative-types.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"shipping_class": "",
5454
"shipping_class_id": 134,
5555
"reviews_allowed": true,
56-
"average_rating": "4.30",
56+
"average_rating": 4.30,
5757
"rating_count": 23,
5858
"related_ids": [
5959
31,

0 commit comments

Comments
 (0)