Extended RestOptions with dateDecodingStrategy so for each request th… - #19
Conversation
…is can be set by default using .iso8601
PR Compliance Guide 🔍(Compliance updated until commit 2fe4c23)Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label Previous compliance checksCompliance check up to commit 2fe4c23
|
||||||||||||||||||||||||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
User description
…is can be set by default using .iso8601
PR Type
Enhancement
Description
Add configurable
JSONDecodertoDeserializerprotocol for date decoding strategyExtend
RestOptionswithdateDecodingStrategyproperty defaulting to ISO-8601Apply date decoding strategy from
RestOptionsto deserializer's JSON decoderRemove platform-specific logging bootstrap code from test setup
Diagram Walkthrough
File Walkthrough
Deserializer.swift
Add configurable JSONDecoder to deserializersSources/SwiftRestRequests/Deserializer.swift
jsonDecoderproperty toDeserializerprotocoljsonDecoderinDecodableDeserializerwith defaultJSONDecoder()instancejsonDecodertonilinVoidDeserializerandDataDeserializerone
RestApiCaller.swift
Apply date decoding strategy to deserializerSources/SwiftRestRequests/RestApiCaller.swift
dateDecodingStrategyfromRestOptionsto deserializer's JSONdecoder before making request
RestOptions.swift
Add configurable date decoding strategy optionSources/SwiftRestRequests/RestOptions.swift
dateDecodingStrategyproperty toRestOptionsstructJSONDecoder.DateDecodingStrategy.iso8601for consistentdate handling
AbstractRestApiCallerTests.swift
Remove platform-specific logging bootstrap codeTests/SwiftRestRequestsTests/AbstractRestApiCallerTests.swift
bootstrap
#if os(Linux)andOSLogHandlerinitialization