Skip to content

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

Merged
dazuma merged 2 commits intogoogleapis:mainfrom
nicholasdower:main
Feb 23, 2024
Merged

fix(core): allow BaseService#root_url to be an Addressable::URI#17895
dazuma merged 2 commits intogoogleapis:mainfrom
nicholasdower:main

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
Contributor

@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!

Copy link
Contributor

@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
@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