From da105eb3dd66935401c7740a132b3d18d77294ec Mon Sep 17 00:00:00 2001 From: Colin Wilk Date: Mon, 2 Oct 2023 01:10:42 +0200 Subject: Add pydantic to dataclasses Verifies the type annotations on the classes. This commit also fixes a bug where an invalid type was returned for suggestions of a Tag. The return type was a dict of a Micro Tag Structure but it was expected to be a string (see szurubooru.py) Signed-off-by: Colin Wilk --- src/lib/szurubooru.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/szurubooru.py') diff --git a/src/lib/szurubooru.py b/src/lib/szurubooru.py index 1219cfb..38c6265 100644 --- a/src/lib/szurubooru.py +++ b/src/lib/szurubooru.py @@ -533,7 +533,7 @@ class Szurubooru: category=c["category"], description=c["description"], implications=list(map(lambda a: a["names"][0], c["implications"])), - suggestions=c["suggestions"], + suggestions=list(map(lambda a: a["names"][0], c["suggestions"])), ) def tag_exists(self, name: str) -> bool: -- cgit v1.2.3