spec/support/utils/raml_parser.rb in chatwork-0.7.0 vs spec/support/utils/raml_parser.rb in chatwork-0.8.0
- old
+ new
@@ -31,11 +31,11 @@
return trait.first.last if trait.first.first == trait_name
end
nil
end
- def self.find_query_parameter_example(verb, path) # rubocop:disable Metrics/MethodLength
+ def self.find_query_parameter_example(verb, path)
resource = find_resource(verb, path)
return {} unless resource
parameter_example = {}
@@ -47,11 +47,10 @@
end
if resource["is"]
resource["is"].each do |trait_name|
trait = find_trait(trait_name)
- next unless trait
- next unless trait["queryParameters"]
+ next if !trait || !trait["queryParameters"]
trait["queryParameters"].each do |name, value|
example = find_example(value)
parameter_example[name] = example if example
end