You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Flight Orders Management API returns en empty body with status code 204 when an order is deleted successfully. The SDK doesn't handle this use case properly; it throws a ParserException as the API does not return a FlightOrder object, instead returns the empty response with code 204.
How to reproduce
import com.amadeus.Amadeus;
import com.amadeus.booking.FlightOrder;
import com.amadeus.exceptions.ResponseException;
public class FlightOrderManagement {
public static void main(String[] args) throws ResponseException {
Amadeus amadeus = Amadeus
.builder("client_key","client_secret")
.build();
com.amadeus.resources.FlightOrder order = amadeus.booking.flightOrder("eJzTd9cP8A8y8nIDAAtUAlk").delete();
if (order.getResponse().getStatusCode() != 204) {
System.out.println("Wrong status code: " + order.getResponse().getStatusCode());
System.exit(-1);
}
System.out.println("deleted");
}
}
Exception in thread "main" com.amadeus.exceptions.ParserException: [204]
at com.amadeus.Response.detectError(Response.java:79)
at com.amadeus.HTTPClient.execute(HTTPClient.java:361)
at com.amadeus.HTTPClient.unauthenticatedRequest(HTTPClient.java:253)
at com.amadeus.HTTPClient.request(HTTPClient.java:339)
at com.amadeus.HTTPClient.delete(HTTPClient.java:94)
at com.amadeus.booking.FlightOrder.delete(FlightOrder.java:85)
at com.amadeus.booking.FlightOrder.delete(FlightOrder.java:95)
at flightsearch.FlightSearch.main(FlightSearch.java:17)
The text was updated successfully, but these errors were encountered:
The Flight Orders Management API returns en empty body with status code 204 when an order is deleted successfully. The SDK doesn't handle this use case properly; it throws a ParserException as the API does not return a FlightOrder object, instead returns the empty response with code 204.
How to reproduce
The text was updated successfully, but these errors were encountered: