Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plan() method to return Route, Trip, Agency gtfsId #29

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/main/java/org/opentripplanner/client/model/Agency.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package org.opentripplanner.client.model;

public record Agency(String name) {}
import com.fasterxml.jackson.annotation.JsonProperty;

public record Agency(@JsonProperty("gtfsId") String id, String name) {}
1 change: 1 addition & 0 deletions src/main/java/org/opentripplanner/client/model/Leg.java
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ public record Leg(
Duration duration,
double distance,
Route route,
Trip trip,
List<FareProductUse> fareProducts,
OptionalDouble accessibilityScore) {

7 changes: 6 additions & 1 deletion src/main/java/org/opentripplanner/client/model/Route.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
package org.opentripplanner.client.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Optional;

public record Route(
Optional<String> shortName, Optional<String> longName, TransitMode mode, Agency agency) {
@JsonProperty("gtfsId") String id,
Optional<String> shortName,
Optional<String> longName,
TransitMode mode,
Agency agency) {

/**
* Either the short name (if it has one) or the long name.
9 changes: 9 additions & 0 deletions src/main/java/org/opentripplanner/client/model/Trip.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package org.opentripplanner.client.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Optional;

public record Trip(
@JsonProperty("gtfsId") String id,
Optional<String> tripShortName,
Optional<String> tripHeadsign) {}
5 changes: 5 additions & 0 deletions src/main/resources/queries/plan.graphql
Original file line number Diff line number Diff line change
@@ -36,12 +36,17 @@ query {
}
mode
route {
gtfsId
shortName
longName
agency {
gtfsId
name
}
}
trip {
gtfsId tripShortName tripHeadsign
}
duration
distance
intermediatePlaces {