Generalized values validation using a map of types