Fix exception when API desc doesn't contain blacklisted params (#768)

This commit is contained in:
soylent 2019-03-20 15:58:19 -06:00 committed by Graham Paye
parent 234837d8a2
commit 56df9903e1
2 changed files with 19 additions and 1 deletions

View File

@ -163,7 +163,7 @@ module Google
end
def parameters
Hash[(@parameters || {}).sort].reject! { |k, _v| PARAMETER_BLACKLIST.include?(k) }
Hash[(@parameters || {}).sort].delete_if { |k, _v| PARAMETER_BLACKLIST.include?(k) }
end
def schemas

View File

@ -326,4 +326,22 @@ EOF
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