Open barbeau opened 2 years ago
Comment by barbeau
Friday Jul 07, 2017 at 20:34 GMT
Here's the commit that added rule E006 (as well as a few other related rules), which is a good reference for what pieces of information (rule, documentation, unit tests) need to be added to the project for each new rule - https://github.com/CUTR-at-USF/gtfs-realtime-validator/commit/51a4d5f7ee63a4beb7f4ff03b671bdc29c55244c. Note that some of this code has since been refactored, so please take a look at the master branch for FrequencyTypeZeroValidator
and FrequencyTypeOneValidator
to see the most recent version of the code.
Comment by barbeau
Friday Jul 07, 2017 at 20:39 GMT
@Suryakandukoori This is probably a good rule to start on, in terms of implementing new rules for the first time. It mirrors the existing rule E006
, but for a different set of trips in a GTFS feed (see above for more info).
Please take a look and let me know if you have any questions.
Relevant Best Practice:
For trips denoted in
GTFS frequency.txt
as frequency-based by setting exact_times=0 or omitting the exact_times field InTripUpdate.StopTimeUpdate
, all oftrip_id
,start_time
, andstart_date
must be provided when describing trip inTripUpdate
orVehiclePosition
by usingTripDescriptor
.
Summary:
TripDescriptor field must contain trip_id, start_time, and start_date if the trip is defined in GTFS frequencies.txt with
exact_times=1
. If the TripDescriptor doesn't contain trip_id, start_time, and start_date, this is an error. See https://developers.google.com/transit/gtfs-realtime/reference/TripDescriptor.Note we have
E006
for frequency-based exact_times = 0 trips implemented inFrequencyTypeZeroValidator
which is this same concept but forexact_times=0
trips, but I'd prefer to separate these into two different errors to draw out the distinctions for the two types of trips. So, this new rule would be implemented inFrequencyTypeOneValidator
, with the unit tests being implemented inFrequencyTypeOneValidatorTest
.