Skip to content
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

handle deprecated endpoints #353

Merged

Conversation

salilgupta1
Copy link
Contributor

@salilgupta1 salilgupta1 commented Jan 24, 2020

One thing to note:

  • We'll have code that asserts that an endpoint must have both deprecated and warning set, not one or the other.

This PR will close #345.

@elsander
Copy link
Contributor

@stephen-hoover Wanted to flag this for you, since you might have more context on the original decision here.

@salilgupta1 , can you note in the description that this closes #345 ?

deprecated = operation.get('deprecated', False)
if 'deprecated' in summary.lower() or deprecated:
deprecation_warning = operation.get("x-deprecation-warning", None)
if 'deprecated' in summary.lower():
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to leave this in because there seem to be a handful of endpoints that use this paradigm. We can get rid of this once we remove those endpoints.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange that we have endpoints which explicitly do not work but are marked as deprecated. This seems like a reasonable workaround in the meantime.

@stephen-hoover
Copy link

@stephen-hoover Wanted to flag this for you, since you might have more context on the original decision here.

Thanks for the flag, but I don't recall being involved in any discussions around the initial implementation of this part of the code.

Copy link
Contributor

@elsander elsander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

deprecated = operation.get('deprecated', False)
if 'deprecated' in summary.lower() or deprecated:
deprecation_warning = operation.get("x-deprecation-warning", None)
if 'deprecated' in summary.lower():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange that we have endpoints which explicitly do not work but are marked as deprecated. This seems like a reasonable workaround in the meantime.

@elsander elsander merged commit c183668 into civisanalytics:master Jan 28, 2020
@salilgupta1 salilgupta1 deleted the handle-deprecated-endpoints branch January 28, 2020 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ignore_deprecated flag to APIClient
3 participants