From 8dbc1d6f3069cf1fea15da50fce6f0d610d20706 Mon Sep 17 00:00:00 2001 From: Kinsey Moore Date: Tue, 15 Oct 2013 20:02:08 +0000 Subject: [PATCH] Ensure bridge record error responses validate This adds the list of expected errors to the /bridges/{bridgeId}/record ARI documentation so that outbound 4xx errors validate properly. Previously, this would result in a response validation failure. (closes issue ASTERISK-22627) Reported by: Joshua Colp git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@401018 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- res/res_ari_bridges.c | 3 +++ rest-api/api-docs/bridges.json | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/res/res_ari_bridges.c b/res/res_ari_bridges.c index d3b3a649d2..c0b8b0d583 100644 --- a/res/res_ari_bridges.c +++ b/res/res_ari_bridges.c @@ -742,6 +742,9 @@ static void ast_ari_record_bridge_cb( break; case 500: /* Internal Server Error */ case 501: /* Not Implemented */ + case 400: /* Recording name invalid */ + case 404: /* Bridge not found */ + case 409: /* Bridge not in Stasis application; Recording already in progress */ is_valid = 1; break; default: diff --git a/rest-api/api-docs/bridges.json b/rest-api/api-docs/bridges.json index 640cf4c5d5..48e5696c54 100644 --- a/rest-api/api-docs/bridges.json +++ b/rest-api/api-docs/bridges.json @@ -453,6 +453,20 @@ ] } } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Recording name invalid" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application; Recording already in progress" + } ] } ] -- 2.47.2