Closed edpyt closed 3 months ago
example:
@dataclass class User: first_name: str last_name: str @dataclass class UserResponse: full_name: str converter_user_to_response = get_converter( User, UserResponse, recipe=[ link( P[User].first_name & P[User].last_name, P[UserResponse].full_name, coercer=lambda first_name, last_name: f"{first_name} {last_name}" ) ] )
It is implemented with https://github.com/reagento/adaptix/pull/275
example: