jaswdr / faker

:rocket: Ultimate fake data generator for Go with zero dependencies
https://pkg.go.dev/github.com/jaswdr/faker
MIT License
566 stars 59 forks source link

[FEATURE] Add a mechanism to generate a fake data json #70

Closed bhatipradeep closed 1 year ago

bhatipradeep commented 3 years ago

Is your feature request related to a problem? Please describe. Currently we have several generators available in Faker. But what if we have a mechanism which takes a format as input and returns a data with same format completely generated by the generators of faker. The format will contain multiple data fields and nested complexity. This can be useful for generating multiple test scenarios in one go.

Describe the solution you'd like You recursive search and build of data using faker generators.

jaswdr commented 3 years ago

@bhatipradeep thanks for the idea, I agree that it is a good one, the reflect module probably should be used for this, but feel free to sent a PR.

jaswdr commented 1 year ago

I created a new Json generator that can both generate json strings and json objects formatted as map[string]interface{}. The first version with this feature is v1.19.0.

Since this was implemented and released, I'm closing this issue.