# File lib/json-schema/validator.rb, line 35 def to_hash base = {:schema => @schema.uri, :fragment => ::JSON::Schema::Attribute.build_fragment(fragments), :message => message, :failed_attribute => @failed_attribute.to_s.split(":").last.split("Attribute").first} if !@sub_errors.empty? base[:errors] = @sub_errors.map{|e| e.to_hash} end base end