Skip to content

Commit

Permalink
fix(CompareComplyV1): Change Location properties to optional
Browse files Browse the repository at this point in the history
Fixes deserialization issues when the service returned empty values for begin and end
  • Loading branch information
Anthony Oliveri committed Nov 28, 2018
1 parent 19e868e commit 2e66ac5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Source/CompareComplyV1/Models/Location.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ public struct Location: Codable {
/**
The element's `begin` index.
*/
public var begin: Int
public var begin: Int?

/**
The element's `end` index.
*/
public var end: Int
public var end: Int?

// Map each property name to the key that shall be used for encoding/decoding.
private enum CodingKeys: String, CodingKey {
Expand All @@ -47,8 +47,8 @@ public struct Location: Codable {
- returns: An initialized `Location`.
*/
public init(
begin: Int,
end: Int
begin: Int? = nil,
end: Int? = nil
)
{
self.begin = begin
Expand Down

0 comments on commit 2e66ac5

Please sign in to comment.