def _coerce_to_number(value):
    """Attempt to coerce to a 'number' value.

    Since json schema spec is loose here, we'll return the int value
    if it's equal to the float value, otherwise give you a float.
    """
    if int(value) == float(value):
        return int(value)
    return float(value)