Skip to content

Commit 178461a

Browse files
committed
tests/petstorev3 - tags may be strings
1 parent 7330fbf commit 178461a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

tests/petstorev3_test.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@ def goodPet(i):
8282
if (c := i.get("category", None)) is None or not isinstance(c, dict):
8383
i["category"] = dict(id=0, name="default")
8484

85+
if (c := i.get("tags", None)) is None or not isinstance(c, list):
86+
i["tags"] = []
87+
else:
88+
for t in c:
89+
if not isinstance(t, dict) or not set(t.keys()) == frozenset(["id", "name"]):
90+
i["tags"] = []
91+
break
92+
8593
Pet = self.api.resolve_jr(self.api._root, None, Reference(**{"$ref": "#/components/schemas/Pet"}))
8694

8795
if ctx.operationId == "getPetById":

0 commit comments

Comments
 (0)