Respect discovered methods with colons in path
This commit is contained in:
parent
0003e564b1
commit
94a979b512
|
@ -108,7 +108,7 @@ module Google
|
|||
# @return [Addressable::Template] The URI template.
|
||||
def uri_template
|
||||
return @uri_template ||= Addressable::Template.new(
|
||||
self.method_base.join(Addressable::URI.parse(@discovery_document['path']))
|
||||
self.method_base.join(Addressable::URI.parse("./" + @discovery_document['path']))
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -688,5 +688,21 @@ RSpec.describe Google::APIClient do
|
|||
it 'should correctly determine the service root_uri' do
|
||||
expect(@pubsub.root_uri.to_s).to eq('https://pubsub.googleapis.com/')
|
||||
end
|
||||
|
||||
it 'should discover correct method URIs' do
|
||||
list = CLIENT.discovered_method(
|
||||
"pubsub.projects.topics.list", "pubsub", "v1beta2"
|
||||
)
|
||||
expect(list.uri_template.pattern).to eq(
|
||||
"https://pubsub.googleapis.com/v1beta2/{+project}/topics"
|
||||
)
|
||||
|
||||
publish = CLIENT.discovered_method(
|
||||
"pubsub.projects.topics.publish", "pubsub", "v1beta2"
|
||||
)
|
||||
expect(publish.uri_template.pattern).to eq(
|
||||
"https://pubsub.googleapis.com/v1beta2/{+topic}:publish"
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue