-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support type_mapping configuration for request for python server codegen
- Loading branch information
Showing
5 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
23 changes: 23 additions & 0 deletions
23
test/integration/gens/python/server/src/app/transformer/app_transformer_preview_request.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from pydantic import BaseModel | ||
from trust import TypeMapping | ||
from trust.transformer.transformer_preview_request import TransformerPreviewRequestDto | ||
|
||
|
||
class AppTransformerPreviewRequest(BaseModel, TypeMapping[TransformerPreviewRequestDto, 'AppTransformerPreviewRequest']): | ||
start: int | ||
end: int | ||
|
||
@classmethod | ||
def of(cls, dto: TransformerPreviewRequestDto) -> 'AppTransformerPreviewRequest': | ||
return AppTransformerPreviewRequest( | ||
start=dto.start_row, | ||
end=dto.end_row | ||
) | ||
|
||
def to(self) -> TransformerPreviewRequestDto: | ||
return TransformerPreviewRequestDto( | ||
start_row=self.start, | ||
end_row=self.end, | ||
filter_masterpiece={}, | ||
sort_masterpiece=[] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
autoImplement: true | ||
typeMapping: | ||
LiftResponse: app.ibis.app_lift_response.AppLiftResponse | ||
TransformerPreviewRequest: app.transformer.app_transformer_preview_request.AppTransformerPreviewRequest |