From be723e1e722653d2ffbfed5a0d8af4f1f3c1e8e6 Mon Sep 17 00:00:00 2001 From: Morten Bjerg Gregersen Date: Mon, 15 Apr 2024 15:22:51 +0200 Subject: [PATCH] Encode dates in `RequestBody`s with ISO8601 (#175) --- Sources/Bagbutik-Core/Service/RequestBody.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/Bagbutik-Core/Service/RequestBody.swift b/Sources/Bagbutik-Core/Service/RequestBody.swift index c6a5ac91e..d44391f0a 100644 --- a/Sources/Bagbutik-Core/Service/RequestBody.swift +++ b/Sources/Bagbutik-Core/Service/RequestBody.swift @@ -9,6 +9,7 @@ public protocol RequestBody: Encodable { public extension RequestBody { var jsonData: Data { let encoder = JSONEncoder() + encoder.dateEncodingStrategy = .iso8601 return try! encoder.encode(self) } }