Configure mockoon with a seed to always return the same random data between requests

432 views Asked by At

Although I am using faker to generate random data I would like the responses of a given endpoint to be the same on every request.

I noticed the general settings have an input text for setting a seed but does nothing regarding what I am aiming at.

1

There are 1 answers

0
255kb - Mockoon On

Faker.js seeding is not always generating the same information. Instead, it will always generate the same sequence. I'm not sure it's documented on Faker.js' website, but I added this to Mockoon's documentation. If you want the answer to always be the same you can either:

  • use the inline body with "static" data (without templating), something like:
    {
      "username": "john"
    }
    
  • use the data buckets feature as they are only generated once when the server starts.