FlightXML2 API returning invalid JSON as of today


#1

For example, calling: flightxml.flightaware.com/json/F … ident=AA59

Returns:


{"FlightInfoExResult":{"next_offset":15,"flights":{"faFlightID":"AAL59-1330842328-airline-0113","ident":"AAL59","aircrafttype":"B762","filed_ete":"06:15:00","filed_time":1330996432,"filed_departuretime":1331035800,"filed_airspeed_kts":0,"filed_airspeed_mach":"","filed_altitude":0,"route":"MCW J148 DTA RUMPS OAL MOD3","actualdeparturetime":0,"estimatedarrivaltime":1331058900,"actualarrivaltime":0,"diverted":"","origin":"KJFK","destination":"KSFO","originName":"John F Kennedy Intl","originCity":"New York, NY","destinationName":"San Francisco Intl","destinationCity":"San Francisco, CA"},{"faFlightID":"AAL59-1330756920-airline-0059","ident":"AAL59","aircrafttype":"B762","filed_ete":"06:27:00","filed_time":1330949322,"filed_departuretime":1330949400,"filed_airspeed_kts":464,"filed_airspeed_mach":"","filed_altitude":360,"route":"GAYEL J95 BUF J16 ECK J16 MONEE J16 BAE J16 MCW J148 MTU J148 DTA RUMPS OAL MOD3","actualdeparturetime":1330951140,"estimatedarrivaltime":1330972807,"actualarrivaltime":1330972920,"diverted":"","origin":"KJFK","destination":"KSFO","originName":"John F Kennedy Intl","originCity":"New York, NY","destinationName":"San Francisco Intl","destinationCity":"San Francisco, CA"},{"faFlightID":"AAL59-1330928733-airline-0039","ident":"AAL59","aircrafttype":"B762","filed_ete":"06:15:00","filed_time":1330928733,"filed_departuretime":1331122200,"filed_airspeed_kts":0,"filed_airspeed_mach":"","filed_altitude":0,"route":"","actualdeparturetime":0,"estimatedarrivaltime":1331145300,"actualarrivaltime":0,"diverted":"","origin":"KJFK","destination":"KSFO","originName":"John F Kennedy Intl","originCity":"New York, NY","destinationName":"San Francisco Intl","destinationCity":"San Francisco, CA"},{"faFlightID":"AAL59-1330669522-airline-0047","ident":"AAL59","aircrafttype":"B762","filed_ete":"06:23:00","filed_time":1330862797,"filed_departuretime":1330863000,"filed_airspeed_kts":447,"filed_airspeed_mach":"","filed_altitude":380,"route":"GAYEL J95 BUF J16 ECK J16 BAE J16 DUTYS J16 MCW J148 DTA RUMPS OAL MOD3","actualdeparturetime":1330865280,"estimatedarrivaltime":1330886787,"actualarrivaltime":1330886820,"diverted":"","origin":"KJFK","destination":"KSFO","originName":"John F Kennedy Intl","originCity":"New York, NY","destinationName":"San Francisco Intl","destinationCity":"San Francisco, CA"},{"faFlightID":"AAL59-1330583134-airline-0072","ident":"AAL59","aircrafttype":"B762","filed_ete":"06:25:00","filed_time":1330776447,"filed_departuretime":1330776600,"filed_airspeed_kts":443,"filed_airspeed_mach":"","filed_altitude":360,"route":"GAYEL J95 BUF J16 ECK J16 BAE J16 MCW J148 DTA RUMPS OAL MOD3","actualdeparturetime":1330778160,"estimatedarrivaltime":1330799030,"actualarrivaltime":1330798920,"diverted":"","origin":"KJFK","destination":"KSFO","originName":"John F Kennedy Intl","originCity":"New York, NY","destinationName":"San Francisco Intl","destinationCity":"San Francisco, CA"},{"faFlightID":"AAL59-1330496719-airline-0062","ident":"AAL59","aircrafttype":"B762","filed_ete":"06:28:00","filed_time":1330689987,"filed_departuretime":1330690200,"filed_airspeed_kts":456,"filed_airspeed_mach":"","filed_altitude":380,"route":"GAYEL J95 BUF J16 ECK J38 GRB J106 GEP J70 ABR J32 CZI J32 FMG ILA PYE GOLDN6","actualdeparturetime":1330691640,"estimatedarrivaltime":1330713144,"actualarrivaltime":1330713120,"diverted":"","origin":"KJFK","destination":"KSFO","originName":"John F Kennedy Intl","originCity":"New York, NY","destinationName":"San Francisco Intl","destinationCity":"San Francisco, CA"},{"faFlightID":"AAL59-1330628737-53-0","ident":"AAL59","aircrafttype":"B762","filed_ete":"06:28:31","filed_time":1330606020,"filed_departuretime":1330606020,"filed_airspeed_kts":0,"filed_airspeed_mach":"","filed_altitude":0,"route":"","actualdeparturetime":1330606020,"estimatedarrivaltime":1330629331,"actualarrivaltime":1330628884,"diverted":"","origin":"KJFK","destination":"KSFO","originName":"John F Kennedy Intl","originCity":"New York, NY","destinationName":"San Francisco Intl","destinationCity":"San Francisco, CA"},{"faFlightID":"AAL59-1330410338-airline-0007","ident":"AAL59","aircrafttype":"B762","filed_ete":"06:30:00","filed_time":1330603718,"filed_departuretime":1330603800,"filed_airspeed_kts":469,"filed_airspeed_mach":"","filed_altitude":380,"route":"GAYEL J95 BUF J16 ECK J38 GRB J106 GEP J70 ABR J32 FMG ILA PYE GOLDN6","actualdeparturetime":1330606020,"estimatedarrivaltime":1330628164,"actualarrivaltime":1330627320,"diverted":"","origin":"KJFK","destination":"KSFO","originName":"John F Kennedy Intl","originCity":"New York, NY","destinationName":"San Francisco Intl","destinationCity":"San Francisco, CA"},{"faFlightID":"AAL59-1330523281-9-0","ident":"AAL59","aircrafttype":"B762","filed_ete":"06:00:18","filed_time":1330522740,"filed_departuretime":1330522740,"filed_airspeed_kts":0,"filed_airspeed_mach":"","filed_altitude":0,"route":"","actualdeparturetime":1330522740,"estimatedarrivaltime":1330545630,"actualarrivaltime":1330545780,"diverted":"","origin":"KJFK","destination":"KSFO","originName":"John F Kennedy Intl","originCity":"New York, NY","destinationName":"San Francisco Intl","destinationCity":"San Francisco, CA"},{"faFlightID":"AAL59-1330323941-airline-0037","ident":"AAL59","aircrafttype":"B762","filed_ete":"00:20:00","filed_time":1330520712,"filed_departuretime":1330517400,"filed_airspeed_kts":472,"filed_airspeed_mach":"","filed_altitude":360,"route":"DEEZZ2 CANDR J60 DANNR RAV J64 FWA J64 CADIZ J64 BDF DSM J10 OBH BFF J94 FMG ILA PYE GOLDN6","actualdeparturetime":1330522680,"estimatedarrivaltime":1330518360,"actualarrivaltime":1330517760,"diverted":"","origin":"KJFK","destination":"KSFO","originName":"John F Kennedy Intl","originCity":"New York, NY","destinationName":"San Francisco Intl","destinationCity":"San Francisco, CA"},{"faFlightID":"AAL59-1330237519-airline-0104","ident":"AAL59","aircrafttype":"B762","filed_ete":"06:35:00","filed_time":1330430839,"filed_departuretime":1330431000,"filed_airspeed_kts":465,"filed_airspeed_mach":"","filed_altitude":320,"route":"RBV J230 LARRI J230 AIR J80 EMPTY J80 SPI IRK PWE HCT EKR J84 DTA RUMPS OAL MOD3","actualdeparturetime":1330432500,"estimatedarrivaltime":1330453690,"actualarrivaltime":1330453980,"diverted":"","origin":"KJFK","destination":"KSFO","originName":"John F Kennedy Intl","originCity":"New York, NY","destinationName":"San Francisco Intl","destinationCity":"San Francisco, CA"},{"faFlightID":"AAL59-1330151141-airline-0036","ident":"AAL59","aircrafttype":"B762","filed_ete":"06:36:00","filed_time":1330344261,"filed_departuretime":1330344600,"filed_airspeed_kts":477,"filed_airspeed_mach":"","filed_altitude":360,"route":"RBV J230 LARRI J230 AIR J80 VHP KK60K PWE KD57S KU54O RUMPS OAL MOD3","actualdeparturetime":1330346160,"estimatedarrivaltime":1330367851,"actualarrivaltime":1330367820,"diverted":"","origin":"KJFK","destination":"KSFO","originName":"John F Kennedy Intl","originCity":"New York, NY","destinationName":"San Francisco Intl","destinationCity":"San Francisco, CA"},{"faFlightID":"AAL59-1330064733-airline-0012","ident":"AAL59","aircrafttype":"B762","filed_ete":"06:33:00","filed_time":1330258374,"filed_departuretime":1330258200,"filed_airspeed_kts":478,"filed_airspeed_mach":"","filed_altitude":380,"route":"GAYEL J95 BUF J16 ECK J38 GRB J106 GEP J70 ABR J32 FMG ILA PYE GOLDN6","actualdeparturetime":1330260300,"estimatedarrivaltime":1330282522,"actualarrivaltime":1330282740,"diverted":"","origin":"KJFK","destination":"KSFO","originName":"John F Kennedy Intl","originCity":"New York, NY","destinationName":"San Francisco Intl","destinationCity":"San Francisco, CA"},{"faFlightID":"AAL59-1329978347-airline-0031","ident":"AAL59","aircrafttype":"B762","filed_ete":"06:32:00","filed_time":1330171526,"filed_departuretime":1330171800,"filed_airspeed_kts":473,"filed_airspeed_mach":"","filed_altitude":360,"route":"GAYEL J95 BUF J16 YXU J16 ECK J16 BAE J16 MCW J148 DTA RUMPS OAL MOD3","actualdeparturetime":1330173480,"estimatedarrivaltime":1330194719,"actualarrivaltime":1330194840,"diverted":"","origin":"KJFK","destination":"KSFO","originName":"John F Kennedy Intl","originCity":"New York, NY","destinationName":"San Francisco Intl","destinationCity":"San Francisco, CA"},{"faFlightID":"AAL59-1329891934-airline-0060","ident":"AAL59","aircrafttype":"B762","filed_ete":"06:28:00","filed_time":1330086637,"filed_departuretime":1330085400,"filed_airspeed_kts":452,"filed_airspeed_mach":"","filed_altitude":400,"route":"GAYEL J95 BUF J16 ECK J16 BAE J16 MCW J148 DTA RUMPS OAL MOD3","actualdeparturetime":1330088220,"estimatedarrivaltime":1330109291,"actualarrivaltime":1330109280,"diverted":"","origin":"KJFK","destination":"KSFO","originName":"John F Kennedy Intl","originCity":"New York, NY","destinationName":"San Francisco Intl","destinationCity":"San Francisco, CA"}]}}
<!-- fdr failure -->

Note the

at the end. This string is invalid JSON and causes JSON parsers used by clients to return an error. This string started appearing in the API responses today. I’m not sure if it’s an issue with my account or a bug that was introduced by a recently committed code change to your API. Please fix ASAP!


#2

This should be operating correctly now. Thanks for the report.


#3

Thanks!

It would be reassuring to know that there are unit tests to catch this sort of thing before code gets pushed. I’m building an app on top of your platform, and knowing that it could break in the field because of something like this is troubling. Of course servers go down, but it’s hard to plan for invalid data coming from what is otherwise a trusted source.


#4

We actually have extensive automated tests against the SOAP based interfaces, but currently our tests against the JSON interfaces are currently only manually initiated. The offending code change was by a developer working on a completely unrelated piece of the codebase so the impact was not anticipated. Appropriate actions will be taken :slight_smile:


#5

Great! Thanks for the heads-up. I imagine going forward that the JSON interfaces will be the popular choice among developers, so they obviously need good test coverage :slight_smile: