File tree Expand file tree Collapse file tree
src/lib/gen/python/client/templates Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[tool .poetry ]
22name = " trustspeccli"
3- version = " {VERSION} "
3+ version = " 0.1.59 "
44authors = [" Wojciech Karwacki <karwacki.wojciech@gmail.com>" ]
55homepage = " https://github.com/wkarwacki/python-openapi-generator-rust"
66repository = " https://github.com/wkarwacki/python-openapi-generator-rust"
@@ -29,7 +29,7 @@ classifiers = [
2929]
3030
3131[tool .poetry .dependencies ]
32- trustspecpy = " {VERSION} "
32+ trustspecpy = " 0.1.59 "
3333
3434[tool .poetry .scripts ]
3535trust = " trustspeccli.main:run"
Original file line number Diff line number Diff line change 11[package ]
22name = " trustspecpy"
3- version = " {VERSION} "
3+ version = " 0.1.59 "
44edition = " 2021"
55
66[lib ]
Original file line number Diff line number Diff line change 2121{{ indent }} @classmethod
2222{{ indent }} def get(cls) -> '{{ adtParent }}{{ key }} ':
2323{{ indent }} return {{> stubImpl key = (add adtParent key ) val =val adtVar =adtVar indent = (add indent " " )}}
24- {{ indent }} {{ #each val.vars }}{{ #if (or (or (eq this.type " obj" ) (eq this.type " enum" )) this.item this.val )}} {{> dto key = (fmtClass @key ) val =this dtoFormLike = (or ../formLike ../dtoFormLike ) indent = (add ../indent " " ) prefix =../key }} {{ /if }}{{ /each }} {{ #each val.vars }}{{ #if (or (not ../this.formLike ) (not (eq @key " file" )))}}
24+ {{ indent }} {{ #each val.vars }}{{ #if (or (or (eq this.type " obj" ) (eq this.type " enum" )) this.item this.val )}} {{ #if ../adtParent }} {{ >dto key = (fmtClass @key ) val =this prefix = ( add ../adtParent ../key ) indent = ( add ../indent " " ) }} {{ else }} {{> dto key = ( fmtClass @ key ) val = this dtoFormLike = (or ../formLike ../dtoFormLike ) indent = (add ../indent " " ) prefix =../key }} {{ /if }}{{ /if }}{{ /each }} {{ #each val.vars }}{{ #if (or (not ../this.formLike ) (not (eq @key " file" )))}}
2525 {{ ../indent }}{{> var }} {{ /if }}{{ /each }} {{ else if (eq val.type "enum")}} class {{ key }} ({{ #with (valueDef val.vars .[0 ])}}{{ #if (eq type " int" )}} IntEnum{{ else }} str, Enum{{ /if }}{{ /with }} ):
2626{{ #each val.vals }}
2727 {{ ../indent }}{{ fmtEnum this }} = {{ json this }}
28- {{ /each }}{{ /if }} {{ #if ( and ( and ( hasKey this " tl " ) ( not tl )) ( and dtoFormLike ( eq val.type " obj " ))) }}
29-
28+ {{ /each }}{{ /if }}
29+ {{ #if ( and ( and ( hasKey this " tl " ) ( not tl )) ( and dtoFormLike ( eq val.type " obj " ))) }}
3030 {{ ../indent }} @model_validator(mode = "after")
3131 {{ ../indent }} def serialize(cls, {{ fmtName key }} : '{{ fmtClass key }} ') -> str:
3232 {{ ../indent }} return {{ fmtName key }} .model_dump_json(exclude_none=True){{ /if }} {{ #if formLike }}
3333
3434 def form(self) -> dict[str, Any]:
35- return self.model_dump(exclude_none=True){{ /if }} {{ #if (and (eq val.type " obj" ) (and (not val.adt ) (not (typeParams val ))))}} {{ /if }}
35+ return self.model_dump(exclude_none=True){{ /if }} {{ #if (and (eq val.type " obj" ) (and (not val.adt ) (not (typeParams val ))))}} {{ /if }}
Original file line number Diff line number Diff line change 1- Annotated[
1+ Annotated[
22 {{ #each val.adt.map }} {{ ../key }}{{ fmtClass @key }} {{ #unless @last }} | {{ /unless }}{{ /each }} ,
33 Field(discriminator="{{ fmtName val.adt.var }} ")
4- ]
4+ ]
You can’t perform that action at this time.
0 commit comments