diff --git a/.travis.yml b/.travis.yml index cf593a5..36f7415 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ python: - "2.7" - "3.3" - "3.5" + - "3.6" install: - pip install -r requirements-dev.txt - pip install coveralls diff --git a/README.md b/README.md index 57158ae..3562743 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Read the [Document](http://pyswagger.readthedocs.org/en/latest/), or just go thr ##Features - **NEW** convert Swagger Document from older version to newer one. (ex. convert from 1.2 to 2.0) -- support Swagger **1.2**, **2.0** on python ~~2.6~~, **2.7**, **3.3**, **3.5** +- support Swagger **1.2**, **2.0** on python ~~2.6~~, **2.7**, **3.3**, **3.5**, **3.6** - support YAML via [Pretty-YAML](https://github.com/mk-fg/pretty-yaml) - support $ref to **External Document**, multiple swagger.json will be organized into a group of App. And external document with self-describing resource is also supported (refer to [issue](https://github.com/swagger-api/swagger-spec/issues/219)). - type safe, input/output are converted to python types according to [Data Type](https://github.com/wordnik/swagger-spec/blob/master/versions/1.2.md#43-data-types) described in Swagger. You don't need to touch any json schema when using pyswagger. Limitations like **minimum/maximum** or **enum** are also checked. **Model inheritance** also supported. diff --git a/pyswagger/scanner/v1_2/upgrade.py b/pyswagger/scanner/v1_2/upgrade.py index 2323797..f65a5f9 100644 --- a/pyswagger/scanner/v1_2/upgrade.py +++ b/pyswagger/scanner/v1_2/upgrade.py @@ -177,7 +177,7 @@ def _operation(self, path, obj, app): path = obj._parent_.basePath + obj.path if path not in self.__swagger.paths: self.__swagger.paths[path] = objects.PathItem(NullContext()) - + method = obj.method.lower() self.__swagger.paths[path].update_field(method, o) @@ -247,7 +247,7 @@ def _parameter(self, path, obj, app): o.update_field('uniqueItems', obj.uniqueItems) o.update_field('items', convert_items(obj.items, app)) - path = obj._parent_._parent_.basePath + obj._parent_.path + path = obj._parent_._parent_.basePath + obj._parent_.path method = obj._parent_.method.lower() op = getattr(self.__swagger.paths[path], method) op.parameters.append(o) @@ -292,7 +292,7 @@ def swagger(self): if not self.__swagger: return None - common_path = os.path.commonprefix(self.__swagger.paths.keys()) + common_path = os.path.commonprefix(list(self.__swagger.paths)) # remove tailing slash, # because all paths in Paths Object would prefixed with slah. common_path = common_path[:-1] if common_path[-1] == '/' else common_path