mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
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
This commit is contained in:
26
rest-api-templates/param_cleanup.mustache
Normal file
26
rest-api-templates/param_cleanup.mustache
Normal file
@@ -0,0 +1,26 @@
|
||||
{{!
|
||||
* Asterisk -- An open source telephony toolkit.
|
||||
*
|
||||
* Copyright (C) 2013, Digium, Inc.
|
||||
*
|
||||
* David M. Lee, II <dlee@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
}}
|
||||
{{!
|
||||
* Snippet for cleaning up an _args struct.
|
||||
}}
|
||||
{{#query_parameters}}
|
||||
{{#allow_multiple}}
|
||||
ast_free(args.{{c_name}}_parse);
|
||||
ast_free(args.{{c_name}});
|
||||
{{/allow_multiple}}
|
||||
{{/query_parameters}}
|
Reference in New Issue
Block a user