Skip to content

Commit

Permalink
support python 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
mission-liao committed Jan 9, 2017
1 parent 2f91d9e commit 2380b3a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ python:
- "2.7"
- "3.3"
- "3.5"
- "3.6"
install:
- pip install -r requirements-dev.txt
- pip install coveralls
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions pyswagger/scanner/v1_2/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2380b3a

Please sign in to comment.