module L::Schema

def to_a(object)

def to_a(object)
  {
    'type' => 'object',
    'properties' => {
      'items' => {
        'type' => 'array', 'items' => to_h(object)
      }
    },
    'required' => ['items'],
    'additionalProperties' => false
  }
end

def to_h(object)

def to_h(object)
  {
    'type' => 'object',
    "properties": object.inject({}) { |h, (k, v)| h.merge(k.to_s => { 'type' => v.to_s }) },
    "required": object.keys,
    "additionalProperties": false
  }
end