Skip to content

Commit 6874fa7

Browse files
Merge pull request #284 from regulaforensics/develop
Develop -> Stable
2 parents f838d57 + 9c6472d commit 6874fa7

File tree

138 files changed

+219
-219
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+219
-219
lines changed

generator-templates/lenient/model_generic.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}
191191
_items = []
192192
if self.{{{name}}}:
193193
for _item_{{{name}}} in self.{{{name}}}:
194-
if _item_{{{name}}}:
194+
if _item_{{{name}}} and hasattr(_item_{{{name}}}, "to_dict"):
195195
_items.append(_item_{{{name}}}.to_dict())
196196
_dict['{{{baseName}}}'] = _items
197197
{{/items.isEnumOrRef}}
@@ -231,7 +231,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}
231231
{{^isPrimitiveType}}
232232
{{^isEnumOrRef}}
233233
# override the default output from pydantic by calling `to_dict()` of {{{name}}}
234-
if self.{{{name}}}:
234+
if self.{{{name}}} and isinstance(self.{{{name}}}, {{{dataType}}}):
235235
_dict['{{{baseName}}}'] = self.{{{name}}}.to_dict()
236236
{{/isEnumOrRef}}
237237
{{/isPrimitiveType}}

regula/documentreader/webclient/gen/models/area_array.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ def to_dict(self) -> Dict[str, Any]:
7171
_items = []
7272
if self.list:
7373
for _item_list in self.list:
74-
if _item_list:
74+
if _item_list and hasattr(_item_list, "to_dict"):
7575
_items.append(_item_list.to_dict())
7676
_dict['List'] = _items
7777
# override the default output from pydantic by calling `to_dict()` of each item in points (list)
7878
_items = []
7979
if self.points:
8080
for _item_points in self.points:
81-
if _item_points:
81+
if _item_points and hasattr(_item_points, "to_dict"):
8282
_items.append(_item_points.to_dict())
8383
_dict['Points'] = _items
8484
return _dict

regula/documentreader/webclient/gen/models/area_container.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ def to_dict(self) -> Dict[str, Any]:
7171
_items = []
7272
if self.list:
7373
for _item_list in self.list:
74-
if _item_list:
74+
if _item_list and hasattr(_item_list, "to_dict"):
7575
_items.append(_item_list.to_dict())
7676
_dict['List'] = _items
7777
# override the default output from pydantic by calling `to_dict()` of each item in points (list)
7878
_items = []
7979
if self.points:
8080
for _item_points in self.points:
81-
if _item_points:
81+
if _item_points and hasattr(_item_points, "to_dict"):
8282
_items.append(_item_points.to_dict())
8383
_dict['Points'] = _items
8484
return _dict

regula/documentreader/webclient/gen/models/auth_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]:
8080
exclude_none=True,
8181
)
8282
# override the default output from pydantic by calling `to_dict()` of liveness_params
83-
if self.liveness_params:
83+
if self.liveness_params and isinstance(self.liveness_params, LivenessParams):
8484
_dict['livenessParams'] = self.liveness_params.to_dict()
8585
return _dict
8686

regula/documentreader/webclient/gen/models/authenticity_check_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def to_dict(self) -> Dict[str, Any]:
6969
_items = []
7070
if self.list:
7171
for _item_list in self.list:
72-
if _item_list:
72+
if _item_list and hasattr(_item_list, "to_dict"):
7373
_items.append(_item_list.to_dict())
7474
_dict['List'] = _items
7575
return _dict

regula/documentreader/webclient/gen/models/authenticity_check_list_item.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def to_dict(self) -> Dict[str, Any]:
6565
exclude_none=True,
6666
)
6767
# override the default output from pydantic by calling `to_dict()` of authenticity_check_list
68-
if self.authenticity_check_list:
68+
if self.authenticity_check_list and isinstance(self.authenticity_check_list, AuthenticityCheckList):
6969
_dict['AuthenticityCheckList'] = self.authenticity_check_list.to_dict()
7070
return _dict
7171

regula/documentreader/webclient/gen/models/authenticity_check_result.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]:
7373
_items = []
7474
if self.list:
7575
for _item_list in self.list:
76-
if _item_list:
76+
if _item_list and hasattr(_item_list, "to_dict"):
7777
_items.append(_item_list.to_dict())
7878
_dict['List'] = _items
7979
return _dict

regula/documentreader/webclient/gen/models/authenticity_result.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def to_dict(self) -> Dict[str, Any]:
6767
exclude_none=True,
6868
)
6969
# override the default output from pydantic by calling `to_dict()` of authenticity_check_list
70-
if self.authenticity_check_list:
70+
if self.authenticity_check_list and isinstance(self.authenticity_check_list, AuthenticityCheckList):
7171
_dict['AuthenticityCheckList'] = self.authenticity_check_list.to_dict()
7272
return _dict
7373

regula/documentreader/webclient/gen/models/barcode_position_item.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def to_dict(self) -> Dict[str, Any]:
6565
exclude_none=True,
6666
)
6767
# override the default output from pydantic by calling `to_dict()` of barcode_position
68-
if self.barcode_position:
68+
if self.barcode_position and isinstance(self.barcode_position, DocumentPosition):
6969
_dict['BarcodePosition'] = self.barcode_position.to_dict()
7070
return _dict
7171

regula/documentreader/webclient/gen/models/barcode_position_result.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def to_dict(self) -> Dict[str, Any]:
6767
exclude_none=True,
6868
)
6969
# override the default output from pydantic by calling `to_dict()` of barcode_position
70-
if self.barcode_position:
70+
if self.barcode_position and isinstance(self.barcode_position, DocumentPosition):
7171
_dict['BarcodePosition'] = self.barcode_position.to_dict()
7272
return _dict
7373

0 commit comments

Comments
 (0)