Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove JSONCodable protocol #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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.
Jump to
Jump to file
Failed to load files.
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