Skip to content

Commit

Permalink
Merge pull request #510 from mapbox/vk/toll-encoding-fix
Browse files Browse the repository at this point in the history
Toll Collection encoding fix
  • Loading branch information
Udumft authored Jan 4, 2021
2 parents a6e7174 + 0d86deb commit abf914a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/MapboxDirections/Intersection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ extension Intersection: Codable {
try container.encode(classes, forKey: .outletRoadClasses)
}

if let tolls = tollCollection?.type {
if let tolls = tollCollection {
try container.encode(tolls, forKey: .tollCollection)
}

Expand Down
3 changes: 2 additions & 1 deletion Tests/MapboxDirectionsTests/IntersectionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class IntersectionTests: XCTestCase {
"mapbox_streets_v8": [
"class": "street_limited"
],
"toll_collection": ["type": "toll_booth"],
],
[
"out": 1,
Expand Down Expand Up @@ -66,7 +67,7 @@ class IntersectionTests: XCTestCase {
approachLanes: nil,
usableApproachLanes: nil,
outletRoadClasses: [.toll, .restricted],
tollCollection: nil,
tollCollection: TollCollection(type: .booth),
tunnelName: nil,
restStop: nil,
isUrban: nil,
Expand Down

0 comments on commit abf914a

Please sign in to comment.