Skip to content

Commit b50d479

Browse files
committed
Make encode methods public for open model classes (#837)
1 parent adbb51c commit b50d479

File tree

10 files changed

+13
-9
lines changed

10 files changed

+13
-9
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes to Mapbox Directions for Swift
22

3+
## v2.14.2
4+
5+
* The `encode(to:)` methods in `DirectionsOptions`, `MatchOptions`, `RouteOptions`, and others open classes are now declared as open instead of public. ([#837](https://github.com/mapbox/mapbox-directions-swift/pull/837))
6+
37
## v2.14.1
48

59
* Fixed `ProfileIdentifier` comparison for the custom profile identifiers. ([#833](https://github.com/mapbox/mapbox-directions-swift/pull/833))

Sources/MapboxDirections/DirectionsOptions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ open class DirectionsOptions: Codable {
279279
case includesVisualInstructions = "banner_instructions"
280280
}
281281

282-
public func encode(to encoder: Encoder) throws {
282+
open func encode(to encoder: Encoder) throws {
283283
var container = encoder.container(keyedBy: CodingKeys.self)
284284
try container.encode(waypoints, forKey: .waypoints)
285285
try container.encode(profileIdentifier, forKey: .profileIdentifier)

Sources/MapboxDirections/DirectionsResult.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ open class DirectionsResult: Codable, ForeignMemberContainerClass {
7171
}
7272

7373

74-
public func encode(to encoder: Encoder) throws {
74+
open func encode(to encoder: Encoder) throws {
7575
var container = encoder.container(keyedBy: CodingKeys.self)
7676
try container.encode(legs, forKey: .legs)
7777
if let shape = shape {

Sources/MapboxDirections/MapMatching/Match.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ open class Match: DirectionsResult {
8585
try decodeForeignMembers(notKeyedBy: CodingKeys.self, with: decoder)
8686
}
8787

88-
public override func encode(to encoder: Encoder) throws {
88+
open override func encode(to encoder: Encoder) throws {
8989
var container = encoder.container(keyedBy: CodingKeys.self)
9090
try container.encode(confidence, forKey: .confidence)
9191
try container.encode(weight.value, forKey: .weight)

Sources/MapboxDirections/MapMatching/MatchOptions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ open class MatchOptions: DirectionsOptions {
7575
case resamplesTraces = "tidy"
7676
}
7777

78-
public override func encode(to encoder: Encoder) throws {
78+
open override func encode(to encoder: Encoder) throws {
7979
var container = encoder.container(keyedBy: CodingKeys.self)
8080
try container.encode(resamplesTraces, forKey: .resamplesTraces)
8181
try super.encode(to: encoder)

Sources/MapboxDirections/Route.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ open class Route: DirectionsResult {
3838
try decodeForeignMembers(notKeyedBy: CodingKeys.self, with: decoder)
3939
}
4040

41-
public override func encode(to encoder: Encoder) throws {
41+
open override func encode(to encoder: Encoder) throws {
4242
var container = encoder.container(keyedBy: CodingKeys.self)
4343
try container.encodeIfPresent(tollPrices.map { TollPriceCoder(tollPrices: $0) }, forKey: .tollPrices)
4444

Sources/MapboxDirections/RouteOptions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ open class RouteOptions: DirectionsOptions {
163163
case includesTollPrices = "compute_toll_cost"
164164
}
165165

166-
public override func encode(to encoder: Encoder) throws {
166+
open override func encode(to encoder: Encoder) throws {
167167
try super.encode(to: encoder)
168168
var container = encoder.container(keyedBy: CodingKeys.self)
169169
try container.encode(allowsUTurnAtWaypoint, forKey: .allowsUTurnAtWaypoint)

Sources/MapboxDirections/RouteStep.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ open class RouteStep: Codable, ForeignMemberContainerClass {
552552
self.segmentIndicesByIntersection = segmentIndicesByIntersection
553553
}
554554

555-
public func encode(to encoder: Encoder) throws {
555+
open func encode(to encoder: Encoder) throws {
556556
var container = encoder.container(keyedBy: CodingKeys.self)
557557
try container.encodeIfPresent(instructionsSpokenAlongStep, forKey: .instructionsSpokenAlongStep)
558558
try container.encodeIfPresent(instructionsDisplayedAlongStep, forKey: .instructionsDisplayedAlongStep)

Sources/MapboxDirections/VisualInstruction.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ open class VisualInstruction: Codable, ForeignMemberContainerClass {
2828
self.finalHeading = degrees
2929
}
3030

31-
public func encode(to encoder: Encoder) throws {
31+
open func encode(to encoder: Encoder) throws {
3232
var container = encoder.container(keyedBy: CodingKeys.self)
3333
try container.encodeIfPresent(text, forKey: .text)
3434
try container.encodeIfPresent(maneuverType, forKey: .maneuverType)

Sources/MapboxDirections/VisualInstructionBanner.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ open class VisualInstructionBanner: Codable, ForeignMemberContainerClass {
3434
self.drivingSide = drivingSide
3535
}
3636

37-
public func encode(to encoder: Encoder) throws {
37+
open func encode(to encoder: Encoder) throws {
3838
var container = encoder.container(keyedBy: CodingKeys.self)
3939
try container.encode(distanceAlongStep, forKey: .distanceAlongStep)
4040
try container.encode(primaryInstruction, forKey: .primaryInstruction)

0 commit comments

Comments
 (0)