Skip to content

Commit 19e8cfa

Browse files
authored
bugfix/add if statement for support when creating model (#27)
1 parent f89d2a6 commit 19e8cfa

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.0.10
2+
3+
* **Bugfix: Add `None` support in mapping `FileDataMeta` response**
4+
15
## 0.0.9
26

37
* **Support optionally exposing addition metadata around FileData**
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.0.9" # pragma: no cover
1+
__version__ = "0.0.10" # pragma: no cover

unstructured_platform_plugins/etl_uvicorn/api_generator.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ def update_filedata_model(new_type) -> BaseModel:
8181
field_info = NewRecord.model_fields["contents"]
8282
if is_optional(new_type):
8383
field_info.default = None
84+
if new_type is None:
85+
new_type = type(None)
86+
field_info.default = None
8487
new_record_model = create_model(
8588
NewRecord.__name__, contents=(new_type, field_info), __base__=NewRecord
8689
)

0 commit comments

Comments
 (0)