summaryrefslogtreecommitdiff
path: root/rest-api-templates/ari_resource.h.mustache
diff options
context:
space:
mode:
authorDavid M. Lee <dlee@digium.com>2013-08-02 14:36:32 +0000
committerDavid M. Lee <dlee@digium.com>2013-08-02 14:36:32 +0000
commit537ecebd2dc27120144498598f32dec97db6808d (patch)
treea3815f8c3f9cc7e2443d8cebc31a7b1d109aa81d /rest-api-templates/ari_resource.h.mustache
parent10c91bc96eafbf5f897869ede83127c9c267981c (diff)
ARI - implement allowMultiple for parameters
Swagger allows parameters to be specified as 'allowMultiple', meaning that the parameter may be specified as a comma separated list of values. I had written some of the API docs using that, but promptly forgot about implementing it. This patch finally fills in that gap. The codegen template was updated to represent 'allowMultiple' fields as array/size fields in the _args structs. It also parses the comma separated list using ast_app_separate_args(), so quoted strings in the argument will be handled properly. Review: https://reviewboard.asterisk.org/r/2698/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396122 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'rest-api-templates/ari_resource.h.mustache')
-rw-r--r--rest-api-templates/ari_resource.h.mustache12
1 files changed, 12 insertions, 0 deletions
diff --git a/rest-api-templates/ari_resource.h.mustache b/rest-api-templates/ari_resource.h.mustache
index 6396e2b73..8b4b0acec 100644
--- a/rest-api-templates/ari_resource.h.mustache
+++ b/rest-api-templates/ari_resource.h.mustache
@@ -44,9 +44,21 @@
struct ast_{{c_nickname}}_args {
{{#parameters}}
{{#description}}
+{{/description}}
+{{^allow_multiple}}
+{{#description}}
/*! \brief {{{description}}} */
{{/description}}
{{c_data_type}}{{c_space}}{{c_name}};
+{{/allow_multiple}}
+{{#allow_multiple}}
+ /*! \brief Array of {{{description}}} */
+ {{c_data_type}}{{c_space}}*{{c_name}};
+ /*! \brief Length of {{c_name}} array. */
+ size_t {{c_name}}_count;
+ /*! \brief Parsing context for {{c_name}}. */
+ char *{{c_name}}_parse;
+{{/allow_multiple}}
{{/parameters}}
};
{{#is_req}}