From f999a783049f0f2f6d474d8e17aab3fdb5b03bde Mon Sep 17 00:00:00 2001 From: SerenaFeng Date: Fri, 18 Aug 2017 18:02:09 +0800 Subject: in swagger operation parameter supports array type it will be used in scenario update process later Change-Id: Ic44023169f1c0da0946e5e60339ce58076fc8807 Signed-off-by: SerenaFeng --- .../testapi/opnfv_testapi/tornado_swagger/swagger.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'utils/test/testapi/opnfv_testapi') diff --git a/utils/test/testapi/opnfv_testapi/tornado_swagger/swagger.py b/utils/test/testapi/opnfv_testapi/tornado_swagger/swagger.py index 83f389a6b..6125c9554 100644 --- a/utils/test/testapi/opnfv_testapi/tornado_swagger/swagger.py +++ b/utils/test/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) -- cgit 1.2.3-korg