Skip to content
Merged
Show file tree
Hide file tree
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
25 changes: 25 additions & 0 deletions src/main/resources/gtfs/gtfsplus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,31 @@
maxLength: 256
columnWidth: 6
helpContent: Rider category as it should appear on 511.org, such as Child (ages 5-11), Seniors (Ages 62 & Up)
# Below are Fares V2 fields from the GTFS spec that are not part of GTFS+.
# These fields are marked optional for GTFS+ validation purposes.
# (This file does not cover the GTFS+ editor UI, which uses a separate settings file.)
- name: rider_category_name
required: false
inputType: TEXT
maxLength: 256
columnWidth: 6
helpContent: Rider category name for Fares V2 purposes
- name: is_default_fare_category
required: false
inputType: DROPDOWN
options:
- value: '0'
text: Not default
- value: '1'
text: Default
columnWidth: 2
helpContent: Whether category is default for Fares V2 purposes
- name: eligibility_url
required: false
inputType: TEXT
maxLength: 256
columnWidth: 6
helpContent: URL for fare eligibility information

- id: route_attributes
name: route_attributes.txt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,22 @@ void shouldReportCompleteDirectionsRealtimeRoutesFile() throws Exception {
}

@Test
void shouldDetectExtraGtfsPlusFields() throws Exception {
void shouldDetectRiderCategoriesNonFaresV2Fields() throws Exception {
FeedVersion version = createFeedVersion(goldenGateFerry, zipFolderFiles("rider-categories-extra-fields"));
GtfsPlusValidation validation = GtfsPlusValidation.validate(version.id);
assertFalse(
validation.issues.isEmpty(),
"Should have caught those extra non-GTFS+ fields in rider_category.txt."
"Should have caught those extra non-GTFS+/non-FaresV2 fields in rider_category.txt."
);
}

@Test
void shouldPassRiderCategoriesFaresV2Fields() throws Exception {
FeedVersion version = createFeedVersion(goldenGateFerry, zipFolderFiles("rider-categories-faresv2"));
GtfsPlusValidation validation = GtfsPlusValidation.validate(version.id);
assertTrue(
validation.issues.isEmpty(),
"Should pass the FaresV2 fields in rider_category.txt."
);
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
rider_category_id,rider_category_description,rider_category_name
rider_category_id,rider_category_description,rider_category_somefield
1,Adult,Adult
2,Eligible Discount (Senior / Disabled / Medicare cardholder),Discounted
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rider_category_id,rider_category_description,rider_category_name,is_default_fare_category,eligibility_url
1,Adult,Adult,1,
2,Eligible Discount (Senior / Disabled / Medicare cardholder),Discounted,0,https://eligibility.example.com
Loading