MapsterMapper / Mapster

A fast, fun and stimulating object to object Mapper
MIT License
4.3k stars 328 forks source link

Is there going to be a [MaxDepth] attribute? #550

Open JudahMcNicholl opened 1 year ago

JudahMcNicholl commented 1 year ago
Say I have a Class that has 3 Arrays of Classes on it, each has another 2 Arrays of classes on it and the final has 1 Array of class on it
And I want to get 3 deep on Class2, 2 deep on class3 and 1 deep on class4
i.e.

Class1 {
     [MaxDepth(3)]
     Class2[]
     [MaxDepth(2)]
     Class3[]
     [MaxDepth(1)]
     Class4[]
}

Class2 {
    Class5[]
    Class6[]
}

Class3 {
    Class5[]
    Class6[]
}

Class4 {
     Class5[]
     Class6[]
}

Class 5 {
    Class8[]
}

Class 6 {
    Class[9]
}

Class 7 {
    Class10[]
}
SAG11 commented 1 year ago

Hi @JudahMcNicholl , could you please elaborate on how exactly exactly [MaxDepth] should work.