Lines 26-39
const generateDataFromSchema = properties => {
Link Here
|
26 |
return mockData; |
26 |
return mockData; |
27 |
}; |
27 |
}; |
28 |
|
28 |
|
29 |
const buildSamplePatron = () => { |
29 |
const buildSamplePatrons = (count = 1) => { |
30 |
const yamlPath = "api/v1/swagger/definitions/patron.yaml"; |
30 |
const yamlPath = "api/v1/swagger/definitions/patron.yaml"; |
31 |
const schema = readYamlFile(yamlPath); |
31 |
const schema = readYamlFile(yamlPath); |
32 |
return generateDataFromSchema(schema.properties); |
32 |
return Array.from({ length: count }, () => |
|
|
33 |
generateDataFromSchema(schema.properties) |
34 |
); |
35 |
}; |
36 |
|
37 |
const buildSamplePatron = () => { |
38 |
return buildSamplePatrons()[0]; |
33 |
}; |
39 |
}; |
34 |
|
40 |
|
35 |
module.exports = { |
41 |
module.exports = { |
36 |
generateMockData, |
42 |
generateMockData, |
37 |
generateDataFromSchema, |
43 |
generateDataFromSchema, |
38 |
buildSamplePatron, |
44 |
buildSamplePatron, |
|
|
45 |
buildSamplePatrons, |
39 |
}; |
46 |
}; |
40 |
- |
|
|