lib/swagger/dsl/operation.rb in swagger-dsl-1.3.0 vs lib/swagger/dsl/operation.rb in swagger-dsl-1.4.0
- old
+ new
@@ -27,13 +27,11 @@
self["parameters"] = Parameters.new(default_required: default_required, &block)
end
def body(format: @format, dsl: nil, &block)
formats(format).each do |f|
- self["requestBody"]["content"][f] = {
- "schema" => Swagger::DSL::JsonSchema.by(dsl).dsl(&block)
- }
+ self["requestBody"]["content"][f] = { "schema" => Swagger::DSL::JsonSchema.by(dsl).dsl(&block) }
end
end
def body_description(body_description = nil)
self["requestBody"]["description"] = body_description
@@ -44,12 +42,10 @@
end
def render(code = 200, format: @format, dsl: nil, &block)
self["responses"][code] ||= { "content" => {} }
formats(format).each do |f|
- self["responses"][code]["content"][f] = {
- "schema" => Swagger::DSL::JsonSchema.by(dsl).dsl(&block)
- }
+ self["responses"][code]["content"][f] = { "schema" => Swagger::DSL::JsonSchema.by(dsl).dsl(&block) }
end
end
private