Skip to content
Snippets Groups Projects
Commit f5321cd6 authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Make JSONEncoder & JSONDecoder internal

to avoid name collisions when using XXClient library
parent 85bd2d7e
No related branches found
No related tags found
2 merge requests!102Release 1.0.0,!53Custom JSONEncoder & JSONDecoder
import CustomDump
import Foundation
public class JSONDecoder: Foundation.JSONDecoder {
public override init() {
class JSONDecoder: Foundation.JSONDecoder {
override init() {
super.init()
}
public override func decode<T>(_ type: T.Type, from data: Data) throws -> T where T: Decodable {
override func decode<T>(_ type: T.Type, from data: Data) throws -> T where T: Decodable {
do {
let data = convertNumberToString(in: data, at: "Value")
return try super.decode(type, from: data)
......
import CustomDump
import Foundation
public class JSONEncoder: Foundation.JSONEncoder {
public override init() {
class JSONEncoder: Foundation.JSONEncoder {
override init() {
super.init()
}
public override func encode<T>(_ value: T) throws -> Data where T: Encodable {
override func encode<T>(_ value: T) throws -> Data where T: Encodable {
do {
var data = try super.encode(value)
data = convertStringToNumber(in: data, at: "Value")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment