From 004c0cd3f2a00d48d4cbe98deac4759ff21f57de Mon Sep 17 00:00:00 2001 From: Jeffrey Jedele Date: Wed, 12 Jul 2023 16:16:04 +0200 Subject: [PATCH] Fix #31 (#32) Co-authored-by: Jeffrey Jedele --- openapidocs/mk/v3/examples.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openapidocs/mk/v3/examples.py b/openapidocs/mk/v3/examples.py index e9904cd..0e9243c 100644 --- a/openapidocs/mk/v3/examples.py +++ b/openapidocs/mk/v3/examples.py @@ -118,7 +118,11 @@ def get_example(self, schema) -> Any: nullable: true """ items = schema["items"] - return [get_example_from_schema(items) for _ in range(1)] + + if not isinstance(items, list): + items = [items] + + return [get_example_from_schema(item) for item in items] def get_subclasses(cls) -> Iterable[Type]: