-
Notifications
You must be signed in to change notification settings - Fork 1k
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
ISO-8601 date time for GTFS API itinerary responses #5660
ISO-8601 date time for GTFS API itinerary responses #5660
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5660 +/- ##
=============================================
+ Coverage 67.73% 67.77% +0.04%
- Complexity 16424 16505 +81
=============================================
Files 1898 1904 +6
Lines 72031 72213 +182
Branches 7419 7435 +16
=============================================
+ Hits 48788 48941 +153
- Misses 20729 20758 +29
Partials 2514 2514 ☔ View full report in Codecov by Sentry. |
src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls
Outdated
Show resolved
Hide resolved
|
||
type LegTimes { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ComplexTime
?
Call
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there some potential feature of a leg time that differs from a "stop time"? Also, does it make sense to always return this type which includes realtime related information even when it's not really feasible that there is any. For example if you walk from origin to a bike rental station? Maybe we should return an union of "realtime times" and "non-realtime times". Are there any other potential use cases for realtime times other than transit? Maybe we should call the realtime version "TransitTime" or "ComplexTime" and the other "SimpleTime"? For some reason, nothing feels perfect. Also, using a union/interface makes the client maybe slightly more complicated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the best solution would be to make Leg
an interface and the implementations define what kind of time it provides.
But we all know that we can only do that with a new schema.
I will be doing some thinking if a union is better or not.
Btw I stumpled upon https://github.com/graphql-java/graphql-java-extended-scalars?tab=readme-ov-file#how-to-add-extended-scalars-to-your-schema while researching how to utilize the extended scalars for the new plan query. Maybe we should use the |
src/main/java/org/opentripplanner/framework/time/OffsetDateTimeParser.java
Show resolved
Hide resolved
src/main/java/org/opentripplanner/apis/gtfs/GraphQLScalars.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opentripplanner/framework/time/OffsetDateTimeParser.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opentripplanner/model/plan/ScheduledTransitLeg.java
Outdated
Show resolved
Hide resolved
src/test/java/org/opentripplanner/apis/gtfs/GraphQLScalarsTest.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opentripplanner/apis/gtfs/GraphQLScalars.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opentripplanner/apis/gtfs/GraphQLScalars.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opentripplanner/apis/gtfs/GraphQLScalars.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opentripplanner/apis/gtfs/GraphQLScalars.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opentripplanner/model/plan/StopArrivalMapper.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opentripplanner/apis/gtfs/GraphQLScalars.java
Outdated
Show resolved
Hide resolved
I will wait to merge this until we released 2.5.0. |
Summary
This PR adds ISO-8601 formatted time responses to the GTFS GraphQL API.
I would like to speak about a few names in the dev meeting before, for example what is the realtime equivalent of the a "scheduled time"? I've called it "actual time" but there are a few other candidates:
Unit tests
Added.
Documentation
I would like to have a first round of review before I work more on the documenation.