mirror of
https://github.com/metabolist/metatext.git
synced 2025-01-01 09:58:40 +00:00
17 lines
412 B
Swift
17 lines
412 B
Swift
|
// Copyright © 2020 Metabolist. All rights reserved.
|
||
|
|
||
|
import Foundation
|
||
|
|
||
|
class MastodonEncoder: JSONEncoder {
|
||
|
override init() {
|
||
|
super.init()
|
||
|
|
||
|
let dateFormatter = DateFormatter()
|
||
|
|
||
|
dateFormatter.dateFormat = MastodonAPI.dateFormat
|
||
|
dateEncodingStrategy = .formatted(dateFormatter)
|
||
|
keyEncodingStrategy = .convertToSnakeCase
|
||
|
outputFormatting = .sortedKeys
|
||
|
}
|
||
|
}
|