Closed stefanw closed 3 years ago
I suppose at some point we’ll need a strict
flag to decide the behaviour in case of invalid values.
For now I agree with your pull request, thank you!
Could you just please bump the version, as this is breaking the API?
Hello,
As this would be a bit too permissive, and the behavior might be different for two transit agencies, could it possible to add an Unknown(String)
to the enum? ""
would map to Regular, the MTA file would parse, but you'd have to handle it by hand.
This would also allow to manage some extensions.
If you don't have enough time, we can make that change for you.
I’m merging it and I’ll work from there.
Thank you for the contribution!
This brings
PickupDropOffType
andContinuousPickupDropOff
in line with other optional enums with default values likeLocationType
. The GTFS specification makes (continuous) pickup/drop off optional, but assigns a default value on empty, so theOption
type is misleading: e.g.None
forpickup_type
means the same asSome(PickupDropOffType::Regular)
.That's why I removed the
Option
s onpickup_type
,drop_off_type
,continuous_pickup
andcontinuous_drop_off
. This might be a backwards incompatible change.Additionally, this change allows parsing invalid values for the (continuous) pickup / drop off columns (e.g. "-999", hello again MTA Brooklyn GTFS) and returning the default value instead.