ynab-api icon indicating copy to clipboard operation
ynab-api copied to clipboard

More Nullability issues

Open solipsia opened this issue 3 years ago • 1 comments

When I invoke get_transactions_by_account via the TransactionsApi, I get this error:

ynab_api.exceptions.ApiTypeError: Invalid type for variable 'flag_color'. Required value type is str and passed type was NoneType at ['received_data']['data']['transactions'][0]['flag_color']

Other aspects of the API are working, including get_accounts.

More complete error: Traceback (most recent call last): File "C:\Users\graha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\ynab_api\model_utils.py", line 1725, in get_allof_instances
allof_instance = allof_class._from_openapi_data( File "C:\Users\graha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\ynab_api\model_utils.py", line 46, in wrapped_init return fn(_self, *args, **kwargs) File "C:\Users\graha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\ynab_api\model\transaction_summary.py", line 235, in _from_openapi_data setattr(self, var_name, var_value) File "C:\Users\graha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\ynab_api\model_utils.py", line 176, in setattr self[attr] = value File "C:\Users\graha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\ynab_api\model_utils.py", line 490, in setitem self.set_attribute(name, value) File "C:\Users\graha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\ynab_api\model_utils.py", line 152, in set_attribute value = validate_and_convert_types( File "C:\Users\graha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\ynab_api\model_utils.py", line 1515, in validate_and_convert_types converted_instance = attempt_convert_item(input_value, File "C:\Users\graha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\ynab_api\model_utils.py", line 1386, in attempt_convert_item
raise get_type_error(input_value, ynab_api.exceptions.ApiTypeError: Invalid type for variable 'flag_color'. Required value type is str and passed type was NoneType at ['received_data']['data']['transactions'][0]['flag_color']

solipsia avatar May 15 '22 08:05 solipsia

The exception went away after following the NullFix instructions on the installation page, however, now all the fields that caused the exception are simply showing "None" in the response, e.g. 'payee_name': None

solipsia avatar May 15 '22 08:05 solipsia