🐛 fix missing self instance validate

This commit is contained in:
yanyongyu 2022-01-29 23:55:14 +08:00
parent 5abf55d095
commit 2ec5917709
No known key found for this signature in database
GPG Key ID: 796D8A7FB73396EB

View File

@ -164,7 +164,9 @@ class Message(List[TMS], abc.ABC):
@classmethod
def _validate(cls, value):
if isinstance(value, str):
if isinstance(value, cls):
return value
elif isinstance(value, str):
pass
elif isinstance(value, dict):
value = parse_obj_as(cls.get_segment_class(), value)