Skip to content

Commit

Permalink
[travelmux] verbal_pre_transition_instruction field is optional (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkirk committed Apr 5, 2024
1 parent 418f006 commit 89b9145
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion services/travelmux/src/api/v2/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ pub struct Maneuver {
pub travel_type: String,
pub r#type: u64,
pub verbal_post_transition_instruction: Option<String>,
pub verbal_pre_transition_instruction: String,
pub verbal_pre_transition_instruction: Option<String>,
pub verbal_succinct_transition_instruction: Option<String>,
}

Expand Down
2 changes: 1 addition & 1 deletion services/travelmux/src/api/v3/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ pub struct Maneuver {
pub travel_type: String,
pub r#type: u64,
pub verbal_post_transition_instruction: Option<String>,
pub verbal_pre_transition_instruction: String,
pub verbal_pre_transition_instruction: Option<String>,
pub verbal_succinct_transition_instruction: Option<String>,
}

Expand Down
16 changes: 15 additions & 1 deletion services/travelmux/src/valhalla/valhalla_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ pub struct Summary {
pub extra: HashMap<String, serde_json::Value>,
}

// CLEANUP: rename to LonLat to match their field spelling?
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct LngLat {
pub lat: f64,
Expand Down Expand Up @@ -105,7 +106,20 @@ pub struct Maneuver {
pub travel_type: String,
pub r#type: u64,
pub verbal_post_transition_instruction: Option<String>,
pub verbal_pre_transition_instruction: String,
// Usually, but not always, present - e.g. missing from:
// {
// "type": 39,
// "instruction": "Take the elevator.",
// "time": 21.176,
// "length": 0.018,
// "cost": 21.176,
// "begin_shape_index": 291,
// "end_shape_index": 293,
// "rough": true,
// "travel_mode": "pedestrian",
// "travel_type": "foot"
// },
pub verbal_pre_transition_instruction: Option<String>,
pub verbal_succinct_transition_instruction: Option<String>,
}

Expand Down

0 comments on commit 89b9145

Please sign in to comment.