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

X-Deprecated header implementation #40

Open
hkraal opened this issue Jul 29, 2016 · 3 comments
Open

X-Deprecated header implementation #40

hkraal opened this issue Jul 29, 2016 · 3 comments

Comments

@hkraal
Copy link
Contributor

hkraal commented Jul 29, 2016

As we're getting close to implementing versioning into pycrest I suppose we should support the X-Deprecated header as well.

Question is: should we strive to implement this for a future update or the upcoming release (I think the latter)

My thoughts:

  • raise DeprecationWarning messages when the header is present
  • log deprecation messages
  • add param to __call__() to suppress these messages

The X-Deprecated Header

To help you find out when a resource is updated, old versions will send an X-Deprecated header. It is up to you to decide what to do with this in your app to help alert you to update it.

source: versioning.md

@wtfrank
Copy link
Contributor

wtfrank commented Aug 4, 2016

Maybe dont need to do much about it - it will be stored in the headers of the ApiResponse so if that's available to people then they can check for the header themselves?

Regarding deprecation warning messages, if you think about how many requests you might do to some endpoints, it could mean utterly spamming people with those messages.

@jonobrien
Copy link
Contributor

you could store the queried endpoints and just output one time for each endpoint per version, some logic to control the spamming shouldn't be too difficult?

@Kyria
Copy link
Contributor

Kyria commented Sep 7, 2016

I think you won't get spammed anyway, as the doc says:

Repetitions of a particular warning for the same source location are typically suppressed

Requires a test ^^

It also looks like you can set a warning filter to only throw them once, or explicitly "deactivate" them (28.6.3 in the doc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants