Fix exception when API desc doesn't contain blacklisted params (#768)
This commit is contained in:
parent
234837d8a2
commit
56df9903e1
|
@ -163,7 +163,7 @@ module Google
|
||||||
end
|
end
|
||||||
|
|
||||||
def parameters
|
def parameters
|
||||||
Hash[(@parameters || {}).sort].reject! { |k, _v| PARAMETER_BLACKLIST.include?(k) }
|
Hash[(@parameters || {}).sort].delete_if { |k, _v| PARAMETER_BLACKLIST.include?(k) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def schemas
|
def schemas
|
||||||
|
|
|
@ -326,4 +326,22 @@ EOF
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'with minimal API description' do
|
||||||
|
before do
|
||||||
|
generated_files = Google::Apis::Generator.new.render(
|
||||||
|
'{ "name": "minimal_api", "id": "minimal_api", "version": "v1" }'
|
||||||
|
)
|
||||||
|
|
||||||
|
namespace.send(:binding).eval(
|
||||||
|
generated_files.fetch('google/apis/minimal_api_v1/service.rb')
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
let(:namespace) { Module.new }
|
||||||
|
|
||||||
|
it 'should define service class' do
|
||||||
|
expect(namespace).to be_const_defined('Google::Apis::MinimalApiV1::MinimalApiService')
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue