diff options
author | Serena Feng <feng.xiaowei@zte.com.cn> | 2017-08-22 01:42:23 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-08-22 01:42:23 +0000 |
commit | bf54ed404a3ecca709cea71e3b1cd63e9fcc76e1 (patch) | |
tree | 85d04961382aad719d241b1bbe21b30f9809f68c /testapi/opnfv_testapi | |
parent | 7e96f103820778d7680dc4bb28fc4bb133a1c500 (diff) | |
parent | 3f1ede4deb36a14668b9093cc655a03a753f4bac (diff) |
Merge "in swagger operation parameter supports array type"
Diffstat (limited to 'testapi/opnfv_testapi')
-rw-r--r-- | testapi/opnfv_testapi/tornado_swagger/swagger.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/testapi/opnfv_testapi/tornado_swagger/swagger.py b/testapi/opnfv_testapi/tornado_swagger/swagger.py index 83f389a..6125c95 100644 --- a/testapi/opnfv_testapi/tornado_swagger/swagger.py +++ b/testapi/opnfv_testapi/tornado_swagger/swagger.py @@ -94,11 +94,18 @@ class DocParser(object): def _parse_type(self, **kwargs): arg = kwargs.get('arg', None) - body = self._get_body(**kwargs) - self.params.setdefault(arg, {}).update({ - 'name': arg, - 'dataType': body - }) + code = self._parse_epytext_para('code', **kwargs) + link = self._parse_epytext_para('link', **kwargs) + if code is None: + self.params.setdefault(arg, {}).update({ + 'name': arg, + 'type': link + }) + elif code == 'list': + self.params.setdefault(arg, {}).update({ + 'type': 'array', + 'items': {'type': link} + }) def _parse_in(self, **kwargs): arg = kwargs.get('arg', None) |