[svn-commits] mjordan: branch mjordan/12-messaging r418446 - in /team/mjordan/12-messaging:...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sat Jul 12 22:18:58 CDT 2014


Author: mjordan
Date: Sat Jul 12 22:18:55 2014
New Revision: 418446

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=418446
Log:
Fix documentation

Modified:
    team/mjordan/12-messaging/res/ari/ari_model_validators.c
    team/mjordan/12-messaging/res/ari/ari_model_validators.h
    team/mjordan/12-messaging/rest-api/api-docs/endpoints.json
    team/mjordan/12-messaging/rest-api/api-docs/events.json

Modified: team/mjordan/12-messaging/res/ari/ari_model_validators.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/12-messaging/res/ari/ari_model_validators.c?view=diff&rev=418446&r1=418445&r2=418446
==============================================================================
--- team/mjordan/12-messaging/res/ari/ari_model_validators.c (original)
+++ team/mjordan/12-messaging/res/ari/ari_model_validators.c Sat Jul 12 22:18:55 2014
@@ -629,9 +629,8 @@
 		} else
 		if (strcmp("variables", ast_json_object_iter_key(iter)) == 0) {
 			int prop_is_valid;
-			prop_is_valid = ast_ari_validate_list(
-				ast_json_object_iter_value(iter),
-				ast_ari_validate_text_message_variable);
+			prop_is_valid = ast_ari_validate_containers(
+				ast_json_object_iter_value(iter));
 			if (!prop_is_valid) {
 				ast_log(LOG_ERROR, "ARI TextMessage field variables failed validation\n");
 				res = 0;
@@ -666,60 +665,6 @@
 ari_validator ast_ari_validate_text_message_fn(void)
 {
 	return ast_ari_validate_text_message;
-}
-
-int ast_ari_validate_text_message_variable(struct ast_json *json)
-{
-	int res = 1;
-	struct ast_json_iter *iter;
-	int has_name = 0;
-	int has_value = 0;
-
-	for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
-		if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
-			int prop_is_valid;
-			has_name = 1;
-			prop_is_valid = ast_ari_validate_string(
-				ast_json_object_iter_value(iter));
-			if (!prop_is_valid) {
-				ast_log(LOG_ERROR, "ARI TextMessageVariable field name failed validation\n");
-				res = 0;
-			}
-		} else
-		if (strcmp("value", ast_json_object_iter_key(iter)) == 0) {
-			int prop_is_valid;
-			has_value = 1;
-			prop_is_valid = ast_ari_validate_string(
-				ast_json_object_iter_value(iter));
-			if (!prop_is_valid) {
-				ast_log(LOG_ERROR, "ARI TextMessageVariable field value failed validation\n");
-				res = 0;
-			}
-		} else
-		{
-			ast_log(LOG_ERROR,
-				"ARI TextMessageVariable has undocumented field %s\n",
-				ast_json_object_iter_key(iter));
-			res = 0;
-		}
-	}
-
-	if (!has_name) {
-		ast_log(LOG_ERROR, "ARI TextMessageVariable missing required field name\n");
-		res = 0;
-	}
-
-	if (!has_value) {
-		ast_log(LOG_ERROR, "ARI TextMessageVariable missing required field value\n");
-		res = 0;
-	}
-
-	return res;
-}
-
-ari_validator ast_ari_validate_text_message_variable_fn(void)
-{
-	return ast_ari_validate_text_message_variable;
 }
 
 int ast_ari_validate_caller_id(struct ast_json *json)

Modified: team/mjordan/12-messaging/res/ari/ari_model_validators.h
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/12-messaging/res/ari/ari_model_validators.h?view=diff&rev=418446&r1=418445&r2=418446
==============================================================================
--- team/mjordan/12-messaging/res/ari/ari_model_validators.h (original)
+++ team/mjordan/12-messaging/res/ari/ari_model_validators.h Sat Jul 12 22:18:55 2014
@@ -301,7 +301,7 @@
 /*!
  * \brief Validator for TextMessage.
  *
- * @@@@ FOO
+ * A text message.
  *
  * \param json JSON object to validate.
  * \returns True (non-zero) if valid.
@@ -317,24 +317,6 @@
 ari_validator ast_ari_validate_text_message_fn(void);
 
 /*!
- * \brief Validator for TextMessageVariable.
- *
- * @@@@ 
- *
- * \param json JSON object to validate.
- * \returns True (non-zero) if valid.
- * \returns False (zero) if invalid.
- */
-int ast_ari_validate_text_message_variable(struct ast_json *json);
-
-/*!
- * \brief Function pointer to ast_ari_validate_text_message_variable().
- *
- * See \ref ast_ari_model_validators.h for more details.
- */
-ari_validator ast_ari_validate_text_message_variable_fn(void);
-
-/*!
  * \brief Validator for CallerID.
  *
  * Caller identification
@@ -1135,7 +1117,7 @@
 /*!
  * \brief Validator for TextMessageReceived.
  *
- * @@@@ FOOBAR.
+ * A text message was received from an endpoint.
  *
  * \param json JSON object to validate.
  * \returns True (non-zero) if valid.
@@ -1210,10 +1192,7 @@
  * - body: string (required)
  * - from: string (required)
  * - to: string (required)
- * - variables: List[TextMessageVariable]
- * TextMessageVariable
- * - name: string (required)
- * - value: string (required)
+ * - variables: containers
  * CallerID
  * - name: string (required)
  * - number: string (required)

Modified: team/mjordan/12-messaging/rest-api/api-docs/endpoints.json
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/12-messaging/rest-api/api-docs/endpoints.json?view=diff&rev=418446&r1=418445&r2=418446
==============================================================================
--- team/mjordan/12-messaging/rest-api/api-docs/endpoints.json (original)
+++ team/mjordan/12-messaging/rest-api/api-docs/endpoints.json Sat Jul 12 22:18:55 2014
@@ -229,41 +229,28 @@
 				}
 			}
 		},
-		"TextMessageVariable": {
-			"id": "TextMessageVariable",
-			"description": "@@@@ ",
-			"properties": {
-				"name": {
-					"type": "string",
-					"required": true
-				},
-				"value": {
-					"type": "string",
-					"required": true
-				}
-			}
-		},
 		"TextMessage": {
 			"id": "TextMessage",
-			"description": "@@@@ FOO",
+			"description": "A text message.",
 			"properties": {
 				"from": {
 					"type": "string",
-					"description": "@@@@",
+					"description": "A technology specific URI specifying the source of the message. For sip and pjsip technologies, any SIP URI can be specified. For xmpp, the URI must correspond to the client connection being used to send the message.",
 					"required": true
 				},
 				"to": {
 					"type": "string",
-					"description": "@@@@",
+					"description": "A technology specific URI specifying the destination of the message. Valid technologies include sip, pjsip, and xmp. The destination of a message should be an endpoint.",
 					"required": true
 				},
 				"body": {
 					"type": "string",
-					"description": "F",
+					"description": "The text of the message.",
 					"required": true
 				},
 				"variables": {
-					"type": "List[TextMessageVariable]",
+					"type": "containers",
+					"description": "Technology specific key/value pairs associated with the message.",
 					"required": false
 				}
 			}

Modified: team/mjordan/12-messaging/rest-api/api-docs/events.json
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/12-messaging/rest-api/api-docs/events.json?view=diff&rev=418446&r1=418445&r2=418446
==============================================================================
--- team/mjordan/12-messaging/rest-api/api-docs/events.json (original)
+++ team/mjordan/12-messaging/rest-api/api-docs/events.json Sat Jul 12 22:18:55 2014
@@ -675,7 +675,7 @@
 		},
 		"TextMessageReceived": {
 			"id": "TextMessageReceived",
-			"description": "@@@@ FOOBAR.",
+			"description": "A text message was received from an endpoint.",
 			"properties": {
 				"message": {
 					"required": true,




More information about the svn-commits mailing list