You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for this great project, it save me a lot of time mapping DTOs/BOs !
I was wondering if there could be a way to generate Into with struct flattening without relying on Default, ex:
// Source, built from my API, and is missing some ids extracted from auth or other sourcesstructEntityNew{name:String
description:String}// this struct is built within the Domain layer just for o2o mapping, wrapping the API object and extracted fields#[owned_into(EntityNewBO)]structEntityNewWrapper{#[flatten]wrapped:EntityNew
id:Uuid
user_id:Uuidcomputed_field:Int}// Target object. A default on this doesn't make much sense and bear the risk of missing compilation errors when adding fieldsstructEntityNewBO{id:Uuid
user_id:Uuidcomputed_field:Intname:Stringdescription:String}
The text was updated successfully, but these errors were encountered:
The problem with theoretic #[flatten] attribute is that there is no way for proc macro to know what fields wrapped: EntityNew has. It may even not be a struct. So you have to somehow let o2o know about those fields. Since you need to do Into, you can do this:
Hi,
Thanks for this great project, it save me a lot of time mapping DTOs/BOs !
I was wondering if there could be a way to generate Into with struct flattening without relying on Default, ex:
The text was updated successfully, but these errors were encountered: