Skip to content
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

Feature/faker support #803

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

SjaaLom
Copy link

@SjaaLom SjaaLom commented Mar 29, 2021

With the addition of faker.js to the systemVariableProvider it is possible to generate realistic test data in your requests.

post http://localhost:8081/api/person

{
  "firstName": "{{$faker name.firstName}}",
  "lastName": "{{$faker name.lastName}}",
  "phone": "{{$faker phone.phoneNumber}}",
  "email": "{{$faker internet.email}}",
  "bio": "{{$faker lorum.words}}"
}

For API documentation of Faker.js and full code see: https://github.com/marak/faker.js

@SjaaLom
Copy link
Author

SjaaLom commented Mar 29, 2021

Hi, I would like to merge this faker.js support into the main REST client, to make it easy to create realistic test data in requests.
Please consider this contribution and if you have any questions, just let me know.

@Meir017
Copy link
Contributor

Meir017 commented Mar 29, 2021

@SjaaLom is there autocomplete for the different definitions from faker? (name.firstName, name.lastName...) and if not, would it be possible to add that?

@SjaaLom
Copy link
Author

SjaaLom commented Mar 29, 2021

It does not yet have autocomplete for that. I'm sure it would be possible to add it.
The one drawback would be that you would then be forced to maintain that and keep it in sync with the faker api. What it does now is just pass the expression to faker and let it figure it out.
I think the addition of this feature alone is already a great bonus. But I will definitely take a look what it would take to add autocomplete, although I would prefer to create a separate pull request for that.

@codeandcats
Copy link

codeandcats commented Sep 12, 2022

This would be a great feature. Is there any reason this can't/shouldn't be merged?

@SjaaLom
Copy link
Author

SjaaLom commented Sep 13, 2022

This would be a great feature. Is there any reason this can't/shouldn't be merged?

There is nothing preventing it from being merged, but I wouldn’t hold my breath. Unfortunately, there has not been much action in this repo.

@marcobiedermann
Copy link

@SjaaLom Would you replace faker with @faker-js/faker since it is no longer being maintained

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants