Open JangasCodingplace opened 2 years ago
Simpler Usecase:
@dataclass
class ReviewEntity(JsonSchemaMixin):
source_type: str
source: str
review_id: str
rating: int
date: datetime.date
text: str
group: Optional[str] = None
user: Optional[str] = None
country: Optional[str] = None
city: Optional[str] = None
Error Message for None at User field:
dataclasses_jsonschema.ValidationError: None is not of type 'string'
Failed validating 'type' in schema['properties']['user']:
{'type': 'string'}
On instance['user']:
None
Hello, do you have any plans to fix this issue?
When using "omit_none=False" during serialization (which is available), it's impossible to deserialize back, so the flow is broken.
Code
Error: