(configData, bodyType, isMultiple, stopNodeId)
| 960 | } |
| 961 | |
| 962 | export const getConfigExamplesForPython = (configData, bodyType, isMultiple, stopNodeId) => { |
| 963 | let finalStr = '' |
| 964 | configData = unshiftFiles(configData) |
| 965 | const loop = Math.min(configData.length, 4) |
| 966 | for (let i = 0; i < loop; i += 1) { |
| 967 | const config = configData[i] |
| 968 | let exampleVal = `"example"` |
| 969 | if (config.type === 'string') exampleVal = `"example"` |
| 970 | else if (config.type === 'boolean') exampleVal = `true` |
| 971 | else if (config.type === 'number') exampleVal = `1` |
| 972 | else if (config.type === 'json') exampleVal = `{ "key": "val" }` |
| 973 | else if (config.name === 'files') continue |
| 974 | finalStr += bodyType === 'json' ? `\n "${config.name}": ${exampleVal},` : `\n "${config.name}": ${exampleVal},` |
| 975 | if (i === loop - 1 && bodyType !== 'json') |
| 976 | finalStr += !isMultiple |
| 977 | ? `\n` |
| 978 | : stopNodeId |
| 979 | ? `\n "stopNodeId": "${stopNodeId}"\n` |
| 980 | : `\n "question": "Hey, how are you?"\n` |
| 981 | } |
| 982 | return finalStr |
| 983 | } |
| 984 | |
| 985 | export const getConfigExamplesForCurl = (configData, bodyType, isMultiple, stopNodeId) => { |
| 986 | let finalStr = '' |
no test coverage detected