Skip to content

Commit d3666e6

Browse files
authored
Merge pull request #12 from nimblehq/release/1.1.1
2 parents 54776be + 8a37e2a commit d3666e6

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

JSONAPIMapper.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |spec|
22
spec.name = 'JSONAPIMapper'
33
spec.summary = 'A Swift library for mapping JSON data'
4-
spec.version = '1.1.0'
4+
spec.version = '1.1.1'
55
spec.license = { :type => 'MIT' }
66
spec.homepage = 'https://github.com/nimblehq/JSONMapper'
77
spec.authors = { 'Nimble' => 'dev@nimblehq.co' }

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Once you have your Swift package set up, adding Alamofire as a dependency is as
1212

1313
```swift
1414
dependencies: [
15-
.package(url: "https://github.com/nimblehq/JSONMapper.git", .upToNextMajor(from: "1.1.0"))
15+
.package(url: "https://github.com/nimblehq/JSONMapper.git", from: "1.1.1")
1616
]
1717
```
1818

@@ -21,7 +21,7 @@ dependencies: [
2121
JSONAPIMapper can be added to your project using CocoaPods 0.36 or later by adding the following line to your Podfile:
2222

2323
```ruby
24-
pod 'JSONAPIMapper', '~> 1.1' (check releases to make sure this is the latest version)
24+
pod 'JSONAPIMapper', '1.1.1'
2525
```
2626

2727
## License

Sources/JSONAPIMapper/Models/JSONAPIError.swift

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ import Foundation
99
public struct JSONAPIError: Error, Decodable, Equatable {
1010

1111
public struct Source: Decodable, Equatable {
12-
let parameter: String?
12+
13+
public let parameter: String?
14+
15+
public init(parameter: String? = nil) {
16+
self.parameter = parameter
17+
}
1318
}
1419

1520
public let id: String?
@@ -20,6 +25,22 @@ public struct JSONAPIError: Error, Decodable, Equatable {
2025
public let status: String?
2126
/// application-specific error code
2227
public let code: String?
28+
29+
public init(
30+
id: String? = nil,
31+
title: String? = nil,
32+
detail: String? = nil,
33+
source: Source? = nil,
34+
status: String? = nil,
35+
code: String? = nil
36+
) {
37+
self.id = id
38+
self.title = title
39+
self.detail = detail
40+
self.source = source
41+
self.status = status
42+
self.code = code
43+
}
2344
}
2445

2546
/// JSON:API error object is sent as an array of errors.

0 commit comments

Comments
 (0)