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

Inconsistency in sort field values for Incident API and Alert API #24

Closed
davidban77 opened this issue Oct 21, 2019 · 2 comments
Closed

Comments

@davidban77
Copy link

Hi,

I have stumbled with this error:

HTTP response body: {"message": "Invalid sort field.", "took": 0.001, "requestId": "xzxzxzxzxz", "url": "https://api.opsgenie.com/v1/incidents/"}

This happens when trying to use the list_incidents method on the IncidentApi with:

sort="created_at"

It works when is set as camel case createdAt, but is not consistent with the AlertApi

@mhamzak008
Copy link
Contributor

mhamzak008 commented Nov 6, 2019

Hello,

Thanks for opening up the issue

As mentioned in the documentation of the AlertApi and IncidentApi, both of them accept createdAt value for the sort query parameter, making them consistent with each other.

However, the alertApi does indeed also accept 'created_at' along with 'createdAt'. And making the alertApi stop accepting 'created_at' might introduce breaking changes for some customers and will hence not be introduced for now. We can consider removing it in the next major release of the SDK though.

@davidban77
Copy link
Author

Got it, I thought since is the python SDK the translation was made for almost all variables and method from camel case to snake case, hence I thought the "correct way" was to use created_at.

Thanks for the clarification!

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

No branches or pull requests

2 participants