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

GetService returns a Service with null version #311

Closed
stefangluszek opened this issue Oct 7, 2021 · 5 comments
Closed

GetService returns a Service with null version #311

stefangluszek opened this issue Oct 7, 2021 · 5 comments

Comments

@stefangluszek
Copy link

stefangluszek commented Oct 7, 2021

Client.GetService returns Service and according to the documentation it should have ActiveVersion but that is always null. This is because the underlying API for service does not return the version. There is a similar method GetServiceDetails that returns ServiceDetail which will have both ActiveVersion and Version fields. This is confusing as the readers of the documentation would expect Service returned by GetService to have a proper Version set.

@Integralist
Copy link
Collaborator

Thanks @stefangluszek for raising this issue, this issue was raised previously for which you can see the comment thread here:
#242 (comment)

@stefangluszek
Copy link
Author

True, but I still think this is a common source of confusion and by reading the documentation you assume the version will be there but it's not. Perhaps it would be enough to include this information in the docstring for GetService. Something like:
"The Service object returned by this function might be missing some fields, such as ActiveVersion, use GetServiceDetails instead."
Or at lease explain when you should use GetService and when GetServiceDetails. Or just get rid of GetService altogether if it provides no additional value and GetServiceDetails could be used instead.

@karenetheridge
Copy link

karenetheridge commented Oct 7, 2021

We're working on updating the public documentation.

@karenetheridge
Copy link

as per https://developer.fastly.com/reference/api/services/service/#search-service, active version is not included in this endpoint. The associated versions are provided in array though, and exactly one of those versions will have "active":true.

@Integralist
Copy link
Collaborator

I'm going to close this PR as it looks to be something that will be clarified via the public documentation.

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

3 participants