Service Alerts Invalid

I am getting the following error when decoding the GTFS-RT: entity.alert.cause: enum value expected The cause and effect enums are being defined as 0. The enum values start at 1 and not zero. Can you please look into it

Comments

  •  
    As you can see by the proto definition 0 is an invalid enum value for cause and effecr https://github.com/google/transit/blob/5ce5f0400c349eaf25cb250d4c49bbeb81af7a9a/gtfs-realtime/proto/gtfs-realtime.proto#L406
    Posted by Hidden Tue, 17 Dec 2019 14:51:01 GMT
  •  
    Thank you for your feedback. We have forwarded your query to our developers to see if it’s a quick fix or not. Either way we’ll look to have an update back to you in the next 2 weeks.
    Posted by Hidden Thu, 19 Dec 2019 20:05:47 GMT
  •  
    The initial investigation has been done but we would like to confirm how you are using using the API. Could you please provide the piece of code you are using so we can try to reproduce the issue?
    Posted by Hidden Mon, 13 Jan 2020 21:46:50 GMT
  •  
    We are using these bindings: https://github.com/MobilityData/gtfs-realtime-bindings/blob/master/nodejs/README.md In order to parse the protobuf that we are getting from your apis and there is a zero in the enum values which are 1 indexed not 0 indexed
    Posted by Hidden Mon, 13 Jan 2020 22:29:36 GMT
  •  
    Resolution notes: reply from: at.servicedesk@propellerhead.co.nz Assignee: Andrew Barylskyi Action: updated Resolution: Done - Andrew Barylskyi commented: Hi AtAssist, Could you please provide the next answer to the Reporter of the ticket: Hi, AT Realtime ServiceAlerts API responds in JSON format, not ProtoBuf which description you refer to in your request. Here's an example response for one of the entities of ServiceAlerts API: "entity": [ { "id": "alert-02202-20191217130301_v86.30", "alert": { "active_period": [ { "start": 1579210813, "end": 1579210805 } ], "informed_entity": [ { "route_id": "02202-20191217130301_v86.30", "trip": { "trip_id": "465202897-20191217130301_v86.30", "start_time": "09:40:00", "start_date": "20200117", "schedule_relationship": 0, "route_id": "02202-20191217130301_v86.30", "direction_id": 1 } } ], "cause": "OTHER_CAUSE", "effect": "SIGNIFICANT_DELAYS", "url": { "translation": [ { "text": "https://at.govt.nz/bus-train-ferry", "language": "en" } ] }, "header_text": { "translation": [ { "text": "Minor Delays", "language": "en" } ] }, "description_text": { "translation": [ { "text": "There are minor delays on this line.", "language": "en" } ] } }, "timestamp": "1579213730" } As you can see "cause" field contains "OTHER_CAUSE" as a value and not 0 as you suggested in your request. And this is completely aligned with GTFS documentation we are using: https://developers.google.com/transit/gtfs-realtime/reference#enum-cause Could you please check your code if you trying to bring to NUMBER field value which actually contains a text string? That can cause the situation you have described.
    Posted by Hidden Wed, 08 Apr 2020 23:55:15 GMT
  •  
    Hi thanks for the reply. I've been passing the following in the headers of the request 'Accept': 'application/x-protobuf'. Should I be passing this in the header or simply avoid it since you are saying that Service Alerts responds in JSON
    Posted by Hidden Thu, 09 Apr 2020 15:36:35 GMT
  •  
    As per our developers, please use 'Accept': 'application/json' header or don't use this header at all. Thank you.
    Posted by Hidden Tue, 28 Apr 2020 23:08:27 GMT


You're not signed in. Please sign-in to report an issue or post a comment.