def json_get_allowed_value(_value, _type):
    """Check if a value is allowed in a certain JSON node"""
    if _value in _type[1] or _value == '':
        return _value
    elif _value[0:8].lower() == 'varchar(' and _value[8:len(_value) - 1
        ].isnumeric() and _value[len(_value) - 1] == ')':
        return _value
    else:
        raise Exception('json_get_allowed_value: ' + str(_value) +
            ' is not a valid value in a ' + _type[0])
