I have a yaml file like this:
type: object
properties:
transactionId:
x-faker: random.uuid
description: Transaction internal id
type: string
description:
x-faker: lorem.sentence
description: Transaction description
type: string
categoryId:
x-faker: random.number
description: Unique id of the category
type: integer
required:
- transactionId
- categoryId
I'm using the prism to mock the API response dynamically and it works fine. The only problem is, the categoryId
is a random number which I don't have any control over it. I want it to be a number between 1 and 10. According to the faker.js documentation, it is possible to use the min
and max
attributes to control the random generator but the x-faker
property doesn't support using those parameters. I need to use something like this:
x-faker: random.number({min:1, max:10})
Is there any way to do this?