From 0a8d0e9f62aaf7335b2b3636771fb57b1ac9a5eb Mon Sep 17 00:00:00 2001 From: Denisov Kirill Date: Sun, 18 Oct 2020 22:50:36 +0400 Subject: [PATCH] fix getattr default --- sanic_openapi/doc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sanic_openapi/doc.py b/sanic_openapi/doc.py index cf255d94..5f12aebe 100644 --- a/sanic_openapi/doc.py +++ b/sanic_openapi/doc.py @@ -140,7 +140,9 @@ def definition(self): "properties": { key: serialize_schema(schema) for key, schema in chain( - {key: getattr(self.cls, key) for key in dir(self.cls)}.items(), + { + key: getattr(self.cls, key, None) for key in dir(self.cls) + }.items(), typing.get_type_hints(self.cls).items(), ) if not key.startswith("_")