Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions JSONCodable/JSONCodable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
// Copyright © 2015 matthewcheok. All rights reserved.
//

// convenience protocol

public protocol JSONCodable: JSONEncodable, JSONDecodable {}

// JSONCompatible - valid types in JSON

public protocol JSONCompatible: JSONEncodable {}
Expand Down
2 changes: 1 addition & 1 deletion JSONCodableTests/ClassInheritance.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import Foundation
import JSONCodable

class Parent : JSONCodable
class Parent : JSONEncodable, JSONDecodable
{
var parentProperty1:String = "parent1"
var parentProperty2:String = "parent2"
Expand Down
2 changes: 1 addition & 1 deletion JSONCodableTests/Food.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func ==(lhs: Food, rhs: Food) -> Bool {
return lhs.name == rhs.name && lhs.cuisines == rhs.cuisines
}

extension Food: JSONCodable {
extension Food: JSONEncodable, JSONDecodable {
init(object: JSONObject) throws {
let decoder = JSONDecoder(object: object)
name = try decoder.decode("name")
Expand Down
2 changes: 1 addition & 1 deletion JSONCodableTests/Fruit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func ==(lhs: Fruit, rhs: Fruit) -> Bool {
return lhs.name == rhs.name && lhs.color == rhs.color
}

extension Fruit: JSONCodable {
extension Fruit: JSONEncodable, JSONDecodable {
init(object: JSONObject) throws {
let decoder = JSONDecoder(object: object)
name = try decoder.decode("name")
Expand Down