Skip to content

ynab sdk 2.0 is fails with AttributeError #17

Description

@lrvdijk

I just upgraded to version 2.0 of the SDK, using the new PlansApi class, but it fails with the following error:

  ...
  File "/Users/lucas/Projects/ynab-cost-share/.venv/lib/python3.14/site-packages/pydantic/_internal/_validate_call.py", line 136, in __call__
    res = self.__pydantic_validator__.validate_python(pydantic_core.ArgsKwargs(args, kwargs))
  File "/Users/lucas/Projects/ynab-cost-share/.venv/lib/python3.14/site-packages/ynab/api/plans_api.py", line 650, in get_plans
    return self.api_client.response_deserialize(
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        response_data=response_data,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        response_types_map=_response_types_map,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ).data
    ^
  File "/Users/lucas/Projects/ynab-cost-share/.venv/lib/python3.14/site-packages/ynab/api_client.py", line 314, in response_deserialize
    content_type = response_data.headers.get('content-type')
                   ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'RESTResponse' object has no attribute 'headers'. Did you mean: 'getheaders'?

The ynab.rest.RESTResponse class indeed doesn't have an attribute headers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions