-
Notifications
You must be signed in to change notification settings - Fork 13
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
refactor faker parsing and enable array relationships #85
refactor faker parsing and enable array relationships #85
Conversation
Here is it in action:
output:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested this out! That refactor is 🔥! It strips away the complexity of parsing the faker methods and args! Well done!
@bobbyiliev @sjwiesman passed tests! Looking forward to your reviews |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Well done with this!
…erializeInc#85) * refactor faker parsing and enable array relationships * add helpful error message * update ecommerce example * slight change to array example * update ecommerce example * accommodate breaking change to pass tests * update readme * add warning about executing user input to readme * fix typo * beef up examples with blog example * bump version
What type of PR is this? (check all applicable)
Description
This PR simplifies parsing of faker methods, making more methods available, and making them available in a way that is consistent with faker API docs (see tests/array.json).
As a bonus of parsing faker methods this way, we also gain the ability to generate arrays with the
faker.helpers.uniqueArray
method and specify an array as a parent field in a relationship.This is a breaking change because now you would have to give a string that represents calling a fully qualified faker method, e.g.
"faker.datatype.number()"
instead of"datatype.number"
.Related Tickets & Documents
closes #63
Added to documentation?