mirror of
https://github.com/metabolist/metatext.git
synced 2024-12-23 05:56:30 +00:00
16 lines
412 B
Swift
16 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
|
|
}
|
|
}
|