lib/schemacop/v3/node.rb in schemacop-3.0.6 vs lib/schemacop/v3/node.rb in schemacop-3.0.7
- old
+ new
@@ -159,15 +159,16 @@
item._validate(data, result: item_result)
return item_result.errors.none?
end
def process_json(attrs, json)
- if @schemas.any?
+ if !context.swagger_json? && @schemas.any?
json[:definitions] = {}
@schemas.each do |name, subschema|
json[:definitions][name] = subschema.as_json
end
end
+
attrs.each do |attr|
if options.include?(attr)
json[attr.to_s.camelize(:lower).to_sym] = options[attr]
end
end