Method: JSONSchemer::Result#to_classic

Defined in:
lib/json_schemer/result.rb

#to_classicObject



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/json_schemer/result.rb', line 94

def to_classic
  schema = source.schema
  out = {
    'data' => instance,
    'data_pointer' => resolved_instance_location,
    'schema' => schema.value,
    'schema_pointer' => schema.schema_pointer,
    'root_schema' => schema.root.value,
    'type' => type || CLASSIC_ERROR_TYPES[source.class]
  }
  out['error'] = error
  out['x-error'] = true if @x_error
  out['i18n'] = true if @i18n
  out['details'] = details if details
  out
end