Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit b53112a

Browse files
authored
Add custom coding keys to Activity (#594)
2 parents 7f86258 + df37d2c commit b53112a

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

WordPressKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Pod::Spec.new do |s|
44
s.name = 'WordPressKit'
5-
s.version = '7.2.0'
5+
s.version = '7.3.0-beta.1'
66

77
s.summary = 'WordPressKit offers a clean and simple WordPress.com and WordPress.org API.'
88
s.description = <<-DESC

WordPressKit/Activity.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ import Foundation
33
public struct Activity: Decodable {
44

55
private enum CodingKeys: String, CodingKey {
6-
case activityId
6+
case activityId = "activity_id"
77
case summary
88
case content
99
case published
1010
case name
1111
case type
1212
case gridicon
1313
case status
14-
case isRewindable
15-
case rewindId
14+
case isRewindable = "is_rewindable"
15+
case rewindId = "rewind_id"
1616
case actor
1717
case object
1818
case items

WordPressKit/ActivityServiceRemote.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ private extension ActivityServiceRemote {
184184
}
185185

186186
do {
187-
let decoder = JSONDecoder.apiDecoder
187+
let decoder = JSONDecoder()
188+
decoder.dateDecodingStrategy = .supportMultipleDateFormats
188189
let data = try JSONSerialization.data(withJSONObject: orderedItems, options: [])
189190
let activities = try decoder.decode([Activity].self, from: data)
190191

0 commit comments

Comments
 (0)