From 86e06a341f0bd137e09174bb4410a0483fd8782b Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Tue, 23 Jan 2024 20:05:11 +0100 Subject: [PATCH] Fix Field.origin_type for Optional types --- osc/util/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osc/util/models.py b/osc/util/models.py index 125557ba..8b1df84d 100644 --- a/osc/util/models.py +++ b/osc/util/models.py @@ -125,7 +125,7 @@ class Field(property): origin_type = get_origin(self.type) or self.type if self.is_optional: types = [i for i in self.type.__args__ if i != type(None)] - return types[0] + return get_origin(types[0]) or types[0] return origin_type @property