Conversation
Because the DCP Query Service uses Swagger 3.0/OpenAPI 3.0, this also begins OpenAPI 3.0 compatibility work in the Swagger Client.
DailyDreaming
left a comment
There was a problem hiding this comment.
LGTM, just a couple of comments.
| def help(args): | ||
| query_parser.print_help() | ||
|
|
||
| if sys.version_info >= (2, 7, 9): # See https://bugs.python.org/issue9351 |
There was a problem hiding this comment.
Do we need to worry about python < 2.7.9? This surprised me.
| self.host = "{scheme}://{host}{base}".format(scheme=self.scheme, | ||
| host=self.swagger_spec["host"], | ||
| base=self.swagger_spec["basePath"]) | ||
| if "openapi" in self.swagger_spec: |
There was a problem hiding this comment.
Nit: Would it make sense to have a variable similar to USING_PYTHON2 specifying the swagger version (within the client)?
There was a problem hiding this comment.
I don't think hardcoding the version of the API spec language in each client is necessary/good, because it makes upgrading the server-side version harder. Instead the client should ideally detect the version of the server-supplied spec and adjust accordingly (which is what is done here).
I do agree that version-specific behavior could be better separated in this class. In the interest of expediency I just put a few if statements here, but ideally we would separate the code more thoroughly or even factor it out into an "OpenAPISpecParser" and "SwaggerAPISpecParser" or something.
Codecov Report
@@ Coverage Diff @@
## master #359 +/- ##
=========================================
Coverage ? 84.98%
=========================================
Files ? 39
Lines ? 1785
Branches ? 0
=========================================
Hits ? 1517
Misses ? 268
Partials ? 0
Continue to review full report at Codecov.
|
|
Ignoring codeclimate report. Also, there is an issue with the coverage reporting for this build. Not sure what happened. |
Because the DCP Query Service uses Swagger 3.0/OpenAPI 3.0, this also begins OpenAPI 3.0 compatibility work in the Swagger Client.
Closes HumanCellAtlas/query-service#185