[svn-commits] mjordan: trunk r434598 - in /trunk: ./ res/ari/ rest-api/api-docs/
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Fri Apr 10 09:56:07 CDT 2015
Author: mjordan
Date: Fri Apr 10 09:56:05 2015
New Revision: 434598
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=434598
Log:
res/ari: Fix model validation for ChannelHold event
When the ChannelHold event was added, the 'musicclass' parameter was
erroneously removed. This caused the ChannelHold events to be rejected as
they failed model validation. This patch updates the Swagger schema such that
it now properly reflects the event that is being created.
Hooray for tests that catch things like this.
........
Merged revisions 434597 from http://svn.asterisk.org/svn/asterisk/branches/13
Modified:
trunk/ (props changed)
trunk/res/ari/ari_model_validators.c
trunk/res/ari/ari_model_validators.h
trunk/rest-api/api-docs/events.json
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.
Modified: trunk/res/ari/ari_model_validators.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/ari/ari_model_validators.c?view=diff&rev=434598&r1=434597&r2=434598
==============================================================================
--- trunk/res/ari/ari_model_validators.c (original)
+++ trunk/res/ari/ari_model_validators.c Fri Apr 10 09:56:05 2015
@@ -3245,6 +3245,15 @@
res = 0;
}
} else
+ if (strcmp("musicclass", ast_json_object_iter_key(iter)) == 0) {
+ int prop_is_valid;
+ prop_is_valid = ast_ari_validate_string(
+ ast_json_object_iter_value(iter));
+ if (!prop_is_valid) {
+ ast_log(LOG_ERROR, "ARI ChannelHold field musicclass failed validation\n");
+ res = 0;
+ }
+ } else
{
ast_log(LOG_ERROR,
"ARI ChannelHold has undocumented field %s\n",
Modified: trunk/res/ari/ari_model_validators.h
URL: http://svnview.digium.com/svn/asterisk/trunk/res/ari/ari_model_validators.h?view=diff&rev=434598&r1=434597&r2=434598
==============================================================================
--- trunk/res/ari/ari_model_validators.h (original)
+++ trunk/res/ari/ari_model_validators.h Fri Apr 10 09:56:05 2015
@@ -1434,6 +1434,7 @@
* - application: string (required)
* - timestamp: Date
* - channel: Channel (required)
+ * - musicclass: string
* ChannelLeftBridge
* - type: string (required)
* - application: string (required)
Modified: trunk/rest-api/api-docs/events.json
URL: http://svnview.digium.com/svn/asterisk/trunk/rest-api/api-docs/events.json?view=diff&rev=434598&r1=434597&r2=434598
==============================================================================
--- trunk/rest-api/api-docs/events.json (original)
+++ trunk/rest-api/api-docs/events.json Fri Apr 10 09:56:05 2015
@@ -608,6 +608,11 @@
"required": true,
"type": "Channel",
"description": "The channel that initiated the hold event."
+ },
+ "musicclass": {
+ "required": false,
+ "type": "string",
+ "description": "The music on hold class that the initiator requested."
}
}
},
More information about the svn-commits
mailing list