From 2b856377e1c7ed7670d740fb28d7bc5f084ee93c Mon Sep 17 00:00:00 2001 From: Clay Ellis Date: Wed, 20 Jul 2016 15:13:31 -0600 Subject: [PATCH] Changed the default isKeyPath to true on the new Unbox at keyPath methods --- Sources/Unbox.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Unbox.swift b/Sources/Unbox.swift index 1f96fc5..b4020fe 100644 --- a/Sources/Unbox.swift +++ b/Sources/Unbox.swift @@ -41,12 +41,12 @@ public func Unbox(dictionary: UnboxableDictionary, context: Any? = } /// Unbox a JSON dictionary into a model `T` beginning at a provided key, optionally using a contextual object. Throws `UnboxError`. -public func Unbox(dictionary: UnboxableDictionary, at key: String, isKeyPath: Bool = false, context: Any? = nil) throws -> T { +public func Unbox(dictionary: UnboxableDictionary, at key: String, isKeyPath: Bool = true, context: Any? = nil) throws -> T { return try Unboxer.unboxer(at: key, in: dictionary, isKeyPath: isKeyPath, context: context).performUnboxing() } /// Unbox an array JSON dictionary into a model `T` beginning at a provided key, optionally using a contextual object and/or invalid elements. Throws `UnboxError`. -public func Unbox(dictionary: UnboxableDictionary, at key: String, isKeyPath: Bool = false, context: Any? = nil, allowInvalidElements: Bool = false) throws -> [T] { +public func Unbox(dictionary: UnboxableDictionary, at key: String, isKeyPath: Bool = true, context: Any? = nil, allowInvalidElements: Bool = false) throws -> [T] { return try Unboxer.unboxers(at: key, in: dictionary, isKeyPath: isKeyPath, context: context).mapAllowingInvalidElements(allowInvalidElements, transform: { return try $0.performUnboxing() })