derhuerst / hafas-gtfs-rt-feed

Format HAFAS data as GTFS Realtime.
https://github.com/derhuerst/hafas-gtfs-rt-feed#hafas-gtfs-rt-feed
Other
18 stars 1 forks source link

omitted optional integer fields parsed as 0 #4

Closed derhuerst closed 2 years ago

derhuerst commented 3 years ago
TripUpdate.decode(TripUpdate.encode({trip: {trip_id: '1'}}))
{
  trip: {
    trip_id: '1',
    route_id: '',
    direction_id: 0,
    start_time: '',
    start_date: '',
    schedule_relationship: 0
  },
  vehicle: null,
  stop_time_update: [],
  timestamp: 0,
  delay: 0
}

This will lead to unintentionally wrong processing of e.g. delay downstream.

derhuerst commented 3 years ago

This is due to https://github.com/mafintosh/protocol-buffers/issues/20.

derhuerst commented 2 years ago

Should be fixed because https://github.com/derhuerst/gtfs-rt-bindings/issues/6 is fixed.