Skip to content

Commit c685e2a

Browse files
committed
fix: dump config
1 parent 663a414 commit c685e2a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

templates/python/model_generic.mustache

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}
8282
{{#vendorExtensions.x-is-hit-object}}
8383
@staticmethod
8484
def __dump_item(item):
85-
return item.model_dump(warnings="none") if isinstance(item, BaseModel) else item
85+
return item.model_dump(
86+
by_alias=True,
87+
exclude_none=True,
88+
exclude_unset=True,
89+
warnings="none",
90+
) if isinstance(item, BaseModel) else item
8691

8792
@field_serializer("highlight_result")
8893
def serialize_highlight_result(self, v: HighlightResult | None):

0 commit comments

Comments
 (0)