@ondc/automation-mock-runner 1.3.35 → 1.3.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lib/configHelper.js
CHANGED
|
@@ -257,7 +257,7 @@ async function buildConfigFromFlowConfig(payloads, flowConfig, domain, version,
|
|
|
257
257
|
if (step.input && step.input.length > 0 && step.input[0].jsonSchema) {
|
|
258
258
|
stepConfig.mock.inputs = step.input[0];
|
|
259
259
|
}
|
|
260
|
-
else {
|
|
260
|
+
else if (step.input && step.input.length > 0) {
|
|
261
261
|
stepConfig.mock.inputs.oldInputs = step.input;
|
|
262
262
|
stepConfig.mock.inputs.id = `old_inputs`;
|
|
263
263
|
}
|
|
@@ -274,6 +274,7 @@ async function buildConfigFromFlowConfig(payloads, flowConfig, domain, version,
|
|
|
274
274
|
stepConfig.unsolicited = step.unsolicited;
|
|
275
275
|
config.steps.push(stepConfig);
|
|
276
276
|
}
|
|
277
|
+
config.meta.description = flowConfig.description || "";
|
|
277
278
|
return config;
|
|
278
279
|
}
|
|
279
280
|
async function generatePlaygroundConfigFromFlowConfig(payloads, flowConfig) {
|
|
@@ -35,12 +35,13 @@ function validateGoodConfig(config) {
|
|
|
35
35
|
continue;
|
|
36
36
|
}
|
|
37
37
|
if (step.mock.inputs !== undefined &&
|
|
38
|
+
step.mock.inputs.oldInputs === undefined &&
|
|
38
39
|
Object.keys(step.mock.inputs).length > 0) {
|
|
39
40
|
if (id === undefined || id === null) {
|
|
40
41
|
errors.push(` • ${label}: inputs.id is required when inputs is defined`);
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
|
-
if (id !== undefined) {
|
|
44
|
+
if (id !== undefined && step.mock.inputs.oldInputs === undefined) {
|
|
44
45
|
if (sampleData === undefined || sampleData === null) {
|
|
45
46
|
errors.push(` • ${label}: inputs.sampleData is required when inputs.id is set`);
|
|
46
47
|
}
|