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

fix(core): allow BaseService#root_url to be an Addressable::URI #17895

Merged
merged 2 commits into from
Feb 23, 2024
Merged

fix(core): allow BaseService#root_url to be an Addressable::URI #17895

merged 2 commits into from
Feb 23, 2024

Conversation

nicholasdower
Copy link
Contributor

Follow up to #17131. Addresses #17894.

BaseService#root_url is documented as an Addressable::URI, but in BaseService#root_url= it is used as if it is a String. This results in the following error:

google-apis-core-0.13.0/lib/google/apis/core/base_service.rb:131:in `root_url=': undefined method `include?' for an instance of Addressable::URI (NoMethodError)

          if url_or_template.include? ENDPOINT_SUBSTITUTION
                            ^^^^^^^^^

The tests seem to indicate that root_url was always allowed to be a String and I don't see any code prior to #17131 which required it to be an Addressable::URI. Therefore I am proposing updating the documentation to indicate that it can be either.

Copy link
Member

@dazuma dazuma left a comment

Choose a reason for hiding this comment

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

Thanks for catching this!

google-apis-core/lib/google/apis/core/base_service.rb Outdated Show resolved Hide resolved
google-apis-core/spec/google/apis/core/service_spec.rb Outdated Show resolved Hide resolved
Copy link
Member

@dazuma dazuma left a comment

Choose a reason for hiding this comment

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

I went ahead and made the requested updates on your branch. Will merge this now. Thanks again for finding this!

@dazuma dazuma merged commit acb1097 into googleapis:main Feb 23, 2024
10 checks passed
@nicholasdower
Copy link
Contributor Author

Thanks @dazuma.

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.

2 participants