diff --git a/JSONAPIMapper.podspec b/JSONAPIMapper.podspec index 42073b2..5c2d653 100644 --- a/JSONAPIMapper.podspec +++ b/JSONAPIMapper.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |spec| spec.name = 'JSONAPIMapper' spec.summary = 'A Swift library for mapping JSON data' - spec.version = '1.1.0' + spec.version = '1.1.1' spec.license = { :type => 'MIT' } spec.homepage = 'https://github.com/nimblehq/JSONMapper' spec.authors = { 'Nimble' => 'dev@nimblehq.co' } diff --git a/README.md b/README.md index 49a2e15..7a46f51 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Once you have your Swift package set up, adding Alamofire as a dependency is as ```swift dependencies: [ - .package(url: "https://github.com/nimblehq/JSONMapper.git", .upToNextMajor(from: "1.1.0")) + .package(url: "https://github.com/nimblehq/JSONMapper.git", from: "1.1.1") ] ``` @@ -21,7 +21,7 @@ dependencies: [ JSONAPIMapper can be added to your project using CocoaPods 0.36 or later by adding the following line to your Podfile: ```ruby -pod 'JSONAPIMapper', '~> 1.1' (check releases to make sure this is the latest version) +pod 'JSONAPIMapper', '1.1.1' ``` ## License diff --git a/Sources/JSONAPIMapper/Models/JSONAPIError.swift b/Sources/JSONAPIMapper/Models/JSONAPIError.swift index 666e9e1..28fbae0 100644 --- a/Sources/JSONAPIMapper/Models/JSONAPIError.swift +++ b/Sources/JSONAPIMapper/Models/JSONAPIError.swift @@ -9,7 +9,12 @@ import Foundation public struct JSONAPIError: Error, Decodable, Equatable { public struct Source: Decodable, Equatable { - let parameter: String? + + public let parameter: String? + + public init(parameter: String? = nil) { + self.parameter = parameter + } } public let id: String? @@ -20,6 +25,22 @@ public struct JSONAPIError: Error, Decodable, Equatable { public let status: String? /// application-specific error code public let code: String? + + public init( + id: String? = nil, + title: String? = nil, + detail: String? = nil, + source: Source? = nil, + status: String? = nil, + code: String? = nil + ) { + self.id = id + self.title = title + self.detail = detail + self.source = source + self.status = status + self.code = code + } } /// JSON:API error object is sent as an array of errors.