-
Notifications
You must be signed in to change notification settings - Fork 116
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
Add log warning for deprecated op #163
Conversation
@@ -215,6 +215,16 @@ def construct_params(self, request, op_kwargs): | |||
if not remaining_param.required and remaining_param.has_default(): | |||
marshal_param(remaining_param, None, request) | |||
|
|||
def log_warning_for_deprecated_op(self): | |||
# TODO: Move this logic to bravado_decorators | |||
if self.operation.op_spec.get('deprecated'): |
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.
While functionally equivalent, specifying a default value of False
here is a little more explicit and in line with the spec
if self.operation.op_spec.get('deprecated', False):
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.
ack
Add PR review suggestions. ^ |
Moved warning logic to a separate module |
if rem_date: | ||
message += "Removal Date: {0}".format(rem_date) | ||
|
||
warnings.warn(message, Warning) |
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.
If you want to be super explicit, s/Warning/DeprecationWarning
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.
Used Warning instead of DeprecationWarning, as the latter is by default turned off and hence the warning will get missed.
lgtm |
cc4f543
to
0c538aa
Compare
Add log warning for deprecated op
Fixes #162