Nexmo / oas_parser

An open source Open API Spec 3 Definition Parser
MIT License
51 stars 16 forks source link

initialize instance variable #12

Closed ota42y closed 5 years ago

ota42y commented 6 years ago

When we execute this code with -w option, we got warning. Parameter object not set @name so we should initialize @name.

require 'oas_parser'

d = OasParser::Definition.resolve("./spec/fixtures/petstore-expanded.yml")
path = d.path_by_path('/pets')
endpoint = path.endpoint_by_method('get')
endpoint.query_parameters.map{ |param| param.name }
ruby -w test.rb
/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/oas_parser-0.14.0/lib/oas_parser/abstract_attribute.rb:6: warning: instance variable @name not initialized
/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/oas_parser-0.14.0/lib/oas_parser/abstract_attribute.rb:6: warning: instance variable @name not initialized