Skip to content

Validation error on GET /budget/:id #7

@elowing

Description

@elowing

Hello! Getting this error when fetching my budget. Is it rejecting transactions with no flag set? Any insight?

budgets_api.get_budget_by_id("my-budget-id")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/em/Library/Python/3.9/lib/python/site-packages/pydantic/_internal/_validate_call.py", line 39, in wrapper_function
    return wrapper(*args, **kwargs)
  File "/Users/em/Library/Python/3.9/lib/python/site-packages/pydantic/_internal/_validate_call.py", line 136, in __call__
    res = self.__pydantic_validator__.validate_python(pydantic_core.ArgsKwargs(args, kwargs))
  File "/Users/em/Library/Python/3.9/lib/python/site-packages/ynab/api/budgets_api.py", line 110, in get_budget_by_id
    return self.api_client.response_deserialize(
  File "/Users/em/Library/Python/3.9/lib/python/site-packages/ynab/api_client.py", line 319, in response_deserialize
    return_data = self.deserialize(response_text, response_type, content_type)
  File "/Users/em/Library/Python/3.9/lib/python/site-packages/ynab/api_client.py", line 420, in deserialize
    return self.__deserialize(data, response_type)
  File "/Users/em/Library/Python/3.9/lib/python/site-packages/ynab/api_client.py", line 467, in __deserialize
    return self.__deserialize_model(data, klass)
  File "/Users/em/Library/Python/3.9/lib/python/site-packages/ynab/api_client.py", line 797, in __deserialize_model
    return klass.from_dict(data)
  File "/Users/em/Library/Python/3.9/lib/python/site-packages/ynab/models/budget_detail_response.py", line 87, in from_dict
    "data": BudgetDetailResponseData.from_dict(obj["data"]) if obj.get("data") is not None else None
  File "/Users/em/Library/Python/3.9/lib/python/site-packages/ynab/models/budget_detail_response_data.py", line 88, in from_dict
    "budget": BudgetDetail.from_dict(obj["budget"]) if obj.get("budget") is not None else None,
  File "/Users/em/Library/Python/3.9/lib/python/site-packages/ynab/models/budget_detail.py", line 211, in from_dict
    "transactions": [TransactionSummary.from_dict(_item) for _item in obj["transactions"]] if obj.get("transactions") is not None else None,
  File "/Users/em/Library/Python/3.9/lib/python/site-packages/ynab/models/budget_detail.py", line 211, in <listcomp>
    "transactions": [TransactionSummary.from_dict(_item) for _item in obj["transactions"]] if obj.get("transactions") is not None else None,
  File "/Users/em/Library/Python/3.9/lib/python/site-packages/ynab/models/transaction_summary.py", line 173, in from_dict
    _obj = cls.model_validate({
  File "/Users/em/Library/Python/3.9/lib/python/site-packages/pydantic/main.py", line 703, in model_validate
    return cls.__pydantic_validator__.validate_python(
pydantic_core._pydantic_core.ValidationError: 1 validation error for TransactionSummary
flag_color
  Input should be 'red', 'orange', 'yellow', 'green', 'blue' or 'purple' [type=enum, input_value='', input_type=str]
    For further information visit https://errors.pydantic.dev/2.11/v/enum

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions