diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 4fffaff..086a17c 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -1,4 +1,4 @@ -name: Kotlin CI with Gradle +name: Kotlin on: push: diff --git a/.github/workflows/apple.yml b/.github/workflows/apple.yml index da8edb6..7469111 100644 --- a/.github/workflows/apple.yml +++ b/.github/workflows/apple.yml @@ -1,4 +1,4 @@ -name: Test +name: Swift on: push: diff --git a/android/build.gradle.kts b/android/build.gradle.kts index 13f8c2c..a5941c6 100644 --- a/android/build.gradle.kts +++ b/android/build.gradle.kts @@ -79,7 +79,7 @@ publishing { groupId = "com.osrm" artifactId = "api" - version = "0.0.6" + version = "0.0.7" } } } diff --git a/apple/Sources/OSRM/Models/RouteLeg.swift b/apple/Sources/OSRM/Models/RouteLeg.swift index 79e1ab1..d1a5fc9 100644 --- a/apple/Sources/OSRM/Models/RouteLeg.swift +++ b/apple/Sources/OSRM/Models/RouteLeg.swift @@ -19,14 +19,17 @@ public struct RouteLeg: Codable, Hashable { public var summary: String? public var steps: [RouteStep]? public var annotation: Annotation? + /** A valhalla and mapbox extension for via waypoints. */ + public var viaWaypoints: [String]? - public init(distance: Double? = nil, duration: Double? = nil, weight: Double? = nil, summary: String? = nil, steps: [RouteStep]? = nil, annotation: Annotation? = nil) { + public init(distance: Double? = nil, duration: Double? = nil, weight: Double? = nil, summary: String? = nil, steps: [RouteStep]? = nil, annotation: Annotation? = nil, viaWaypoints: [String]? = nil) { self.distance = distance self.duration = duration self.weight = weight self.summary = summary self.steps = steps self.annotation = annotation + self.viaWaypoints = viaWaypoints } public enum CodingKeys: String, CodingKey, CaseIterable { @@ -36,6 +39,7 @@ public struct RouteLeg: Codable, Hashable { case summary case steps case annotation + case viaWaypoints = "via_waypoints" } // Encodable protocol methods @@ -48,5 +52,6 @@ public struct RouteLeg: Codable, Hashable { try container.encodeIfPresent(summary, forKey: .summary) try container.encodeIfPresent(steps, forKey: .steps) try container.encodeIfPresent(annotation, forKey: .annotation) + try container.encodeIfPresent(viaWaypoints, forKey: .viaWaypoints) } } diff --git a/apple/Tests/OSRM/__Snapshots__/TestDecodeOSRM/testDecodeRouteResponse.1.json b/apple/Tests/OSRM/__Snapshots__/TestDecodeOSRM/testDecodeRouteResponse.1.json index ba8706f..8ece473 100644 --- a/apple/Tests/OSRM/__Snapshots__/TestDecodeOSRM/testDecodeRouteResponse.1.json +++ b/apple/Tests/OSRM/__Snapshots__/TestDecodeOSRM/testDecodeRouteResponse.1.json @@ -138,6 +138,9 @@ } ], "summary" : "AK 1", + "via_waypoints" : [ + + ], "weight" : 56.002 } ], diff --git a/openapi.yaml b/openapi.yaml index 1778310..169e7c1 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -145,6 +145,13 @@ components: $ref: '#/components/schemas/RouteStep' annotation: $ref: '#/components/schemas/Annotation' + via_waypoints: + type: array + nullable: true + default: null + description: A Mapbox and Valhalla extension which indicates which waypoints are passed through rather than creating a new leg. + items: + type: string RouteStep: type: object properties: