-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Begin DCP Query Service CLI #359
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to worry about python < 2.7.9
? This surprised me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #112
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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