lunchable
lunchable copied to clipboard
Escaped API response causes pydantic max_length validation to fail
- lunchable version: 0.9.0
- Python version: 3.11
Description
Lunchmoney API (/v1/categories/group/{category_id}/add
in this case) sometimes seems to send back some escaped characters (eg. /
instead of /
), which results in pydantic max_length
validations to sometimes fail as string length is not counted correctly.
Imo this is probably a bug on the lunchmoney API side though
What I Did
- Create a new category that is of 40 characters long and add it to a category group
- Add a new category in same category group with
insert_into_category_group
method - Error will be raised as the
children[]
will fail instantiation due to having a length > 40 characters.