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

Functions for random data generation #3720

Open
AntonShuvaev opened this issue Feb 9, 2025 · 1 comment
Open

Functions for random data generation #3720

AntonShuvaev opened this issue Feb 9, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@AntonShuvaev
Copy link

Problem to solve

I want to be able to use random data in requests like first name, last name, email, etc. Currently, we're limited to only newUuid and newDate functions.

Proposal

It would be great to have more random data generation functions besides existing newUuid and newDate. As an example, Postman has a great set of dynamic variables powered by faker.js (see docs: https://learning.postman.com/docs/tests-and-scripts/write-scripts/variables-list/). The fake-rs library (https://github.com/cksac/fake-rs) could be used for implementation.

I think it would be convenient to prefix such functions with $ to separate them from usual variables, as this is common in many API clients. For some functions, it would be even better to support arguments (e.g., $randomInt(123), $randomAlphaNumeric(10)). Or even support expressions so we can do things like this {{$randomFirstName + ' ' + $randomLastName}}

@AntonShuvaev AntonShuvaev added the enhancement New feature or request label Feb 9, 2025
@jruot
Copy link

jruot commented Feb 21, 2025

I'm having a similar problem. For example, I would like to pick a random value from a pre-defined list, such as a country code. It would also be good to define the date format for the newDate function.

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

No branches or pull requests

2 participants