jaswdr / faker

:rocket: Ultimate fake data generator for Go with zero dependencies

Home Page:https://pkg.go.dev/github.com/jaswdr/faker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

bhatipradeep opened this issue · comments

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.

@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.

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.