Set lazy by default
See original GitHub issueThis is a feature request.
For people using Faker indeed makes sense to set all attributes “lazy” while setting fixed values only on special cases.
I did have a bad time trying to make it work and ended up using a bunch of factory.LazyFunction(lambda:
Set all calls from random “lazy” would be ok too, but indeed having it as an option makes more sense.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How can I set the default behavior of lazy init in Spring Boot?
I want to set the that for default all beans are lazy loaded. I know that I can add the @Lazy to all...
Read more >Lazy Initialization in Spring Boot 2.2 - Baeldung
By default in Spring, all the defined beans, and their dependencies, are created when the application context is created.
Read more >Lazy Initialization - .NET Framework - Microsoft Learn
Initialize by using default Lazy<T> constructor. The // Orders array itself is not created yet. Lazy<Orders> _orders = new Lazy<Orders>();
Read more >Lazy Initialization in Spring Boot 2.2
By default, when an application context is being refreshed, every bean in the context is created and its dependencies are injected.
Read more >Understanding Lazy Initialization in Spring Boot - SpringHow
By default, Spring Framework creates and injects beans and it's dependencies at the time of context creation or refresh. But with lazy mode, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can also use something like the following for some of your objects (I have made some assumptions and provided some of the issues with those assumptions in comments):
I thought it was deprecated… I think the current state of the integration with faker is confusing 😦