Skip to content

Commit fda4e83

Browse files
and fix client
1 parent efc74b0 commit fda4e83

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

cli/py/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "trustspeccli"
3-
version = "{VERSION}"
3+
version = "0.1.59"
44
authors = ["Wojciech Karwacki <karwacki.wojciech@gmail.com>"]
55
homepage = "https://github.com/wkarwacki/python-openapi-generator-rust"
66
repository = "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]
3535
trust = "trustspeccli.main:run"

plugin/py-binding/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "trustspecpy"
3-
version = "{VERSION}"
3+
version = "0.1.59"
44
edition = "2021"
55

66
[lib]

src/lib/gen/python/client/templates/dto.hbs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
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}}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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+
]

0 commit comments

Comments
 (0)