You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 27, 2024. It is now read-only.
I tried to execute library with the latest version (1.16.0) and I have this error:
TypeError [ERR_INVALID_URL]: Invalid URL: {{base_url}}/companies/:companyId
at onParseError (internal/url.js:279:9)
at new URL (internal/url.js:355:5)
at scrapeURL (C:\Users\kikit\Desktop\LamacomptaApiDoc\bin\p2o_original\node_modules\postman-to-openapi\lib\index.js:358:18)
at postmanToOpenApi (C:\Users\kikit\Desktop\LamacomptaApiDoc\bin\p2o_original\node_modules\postman-to-openapi\lib\index.js:40:58) {
input: '{{base_url}}/companies/:companyId',
code: 'ERR_INVALID_URL'
}
Apparently it's because variables don't replaced ( here: {{base_url}} ).
It's just a note, I know it's already planned to add this feature ;)
My function "setVars" provided here: #131 (comment)
could be useful:
/**
* Populate variables in provided string
*
* @param {string} string String to process
* @param {array} variables Array of variables for replacements
*
* @returns {string} String with variables populated
*/
function setVars(string, variables) {
if (~string.search(/{{\s*[\w\s-]+\s*}}/g)) {
const varKey = string.replace(/[{*|}*]/g, '').trim()
return getVarValue(variables, varKey)
}
return string
}
Hi!
I tried to execute library with the latest version (1.16.0) and I have this error:
Apparently it's because variables don't replaced ( here: {{base_url}} ).
It's just a note, I know it's already planned to add this feature ;)
My function "setVars" provided here: #131 (comment)
could be useful:
Kisses :)