[svn-commits] dlee: branch dlee/ari-event-remodel2 r392406 - in /team/dlee/ari-event-remode...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Jun 21 00:46:21 CDT 2013


Author: dlee
Date: Fri Jun 21 00:46:19 2013
New Revision: 392406

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=392406
Log:
Actually, models without properties shouldn't have any at all

Modified:
    team/dlee/ari-event-remodel2/res/stasis_http/ari_model.c
    team/dlee/ari-event-remodel2/rest-api-templates/ari_model.c.mustache

Modified: team/dlee/ari-event-remodel2/res/stasis_http/ari_model.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-event-remodel2/res/stasis_http/ari_model.c?view=diff&rev=392406&r1=392405&r2=392406
==============================================================================
--- team/dlee/ari-event-remodel2/res/stasis_http/ari_model.c (original)
+++ team/dlee/ari-event-remodel2/res/stasis_http/ari_model.c Fri Jun 21 00:46:19 2013
@@ -38,6 +38,18 @@
 int ari_validate_asterisk_info(struct ast_json *json)
 {
 	int res = 1;
+	struct ast_json_iter *iter;
+
+	for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
+		{
+			ast_log(LOG_ERROR,
+				"ARI AsteriskInfo has undocumented field %s\n",
+				ast_json_object_iter_key(iter));
+			res = 0;
+		}
+	}
+
+
 	return res;
 }
 
@@ -303,6 +315,18 @@
 int ari_validate_dialed(struct ast_json *json)
 {
 	int res = 1;
+	struct ast_json_iter *iter;
+
+	for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
+		{
+			ast_log(LOG_ERROR,
+				"ARI Dialed has undocumented field %s\n",
+				ast_json_object_iter_key(iter));
+			res = 0;
+		}
+	}
+
+
 	return res;
 }
 

Modified: team/dlee/ari-event-remodel2/rest-api-templates/ari_model.c.mustache
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-event-remodel2/rest-api-templates/ari_model.c.mustache?view=diff&rev=392406&r1=392405&r2=392406
==============================================================================
--- team/dlee/ari-event-remodel2/rest-api-templates/ari_model.c.mustache (original)
+++ team/dlee/ari-event-remodel2/rest-api-templates/ari_model.c.mustache Fri Jun 21 00:46:19 2013
@@ -39,7 +39,6 @@
 int ari_validate_{{c_id}}(struct ast_json *json)
 {
 	int res = 1;
-{{#has_properties}}
 	struct ast_json_iter *iter;
 {{#properties}}
 {{#required}}
@@ -110,7 +109,6 @@
 {{/required}}
 {{/properties}}
 
-{{/has_properties}}
 	return res;
 }
 {{/models}}




More information about the svn-commits mailing list