lunchable icon indicating copy to clipboard operation
lunchable copied to clipboard

Escaped API response causes pydantic max_length validation to fail

Open ilaskaev opened this issue 1 year ago • 3 comments

  • 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.

image

Imo this is probably a bug on the lunchmoney API side though

What I Did

  1. Create a new category that is of 40 characters long and add it to a category group
  2. Add a new category in same category group with insert_into_category_group method
  3. Error will be raised as the children[] will fail instantiation due to having a length > 40 characters.

ilaskaev avatar Dec 15 '23 03:12 ilaskaev