-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No preview data generated when @Dowel data class has default values #21
Comments
Yes, right now I can see how this might be inconvenient in certain use-cases. I think code generation could be added for properties with default values, given, their types are supported by I don't have any immediate concerns with the above mentioned approach, will think through different cases, and if everything checks out, will add support for this in the next release. |
A suggestion for including this functionality could be a new param for
|
Yep, @mohsen-biglari, that should work. I'm also thinking if having this configuration at a property level would be needed or not. For example, @Dowel(count = 30, ignoreDefaultValues = true)
data class Person(
val id: Long = 1L,
val name: String,
val bio: String?,
@DrawableRes val avatar: Int = R.drawable.ic_launcher_foreground,
) In this example, I may want to generate random values for the @savvasdalkitsis what do you think? |
I would probably name the property something like |
@savvasdalkitsis, my question is, do you see it as necessary to configure this at the property level, or is class-declaration level configuration sufficient? |
(#21) Add support for overriding default values
@savvasdalkitsis, this has been implemented and would be part of the next release. For now, this solution only addresses this configurability at a class level. I'm still evaluating the need for this configurability at a property level, which if needed would be an additive change, anyway. |
@savvasdalkitsis this has been released as part of the v0.9.0 release. Check it out whenever you get a chance next! |
Library Version: 0..8.0
Describe the Bug:
assuming a class:
The generated provider class only contains empty constructor invocations, generating the same data for each entry.
If you remove the default values, the correct provider class is generated
The text was updated successfully, but these errors were encountered: