   alias Xema.Mapz
   alias Xema.Ref
   alias Xema.Schema
-  alias Xema.SchemaError
   alias Xema.SchemaValidator
 
   @keywords Schema.keywords()


    case {type, keywords} do
      {type, []} -> type
      {:any, [ref: ref]} -> ref
      {:any, keywords} -> keywords
      tuple -> tuple
    end

      |> update()
      |> Schema.new()

  defp schema({value, keywords}, _) do
    case value in Schema.types() do
      true ->
        keywords
        |> Keyword.put(:type, value)
        |> update()
