mulesoft-labs / api-console-cli

A CLI tools for the API console.
Other
14 stars 15 forks source link

AMF API Parser can't work with cd-up "../" #35

Closed hubandr closed 4 years ago

hubandr commented 5 years ago

When doing "build" with a RAML file or doing "generate-model", the file can't be passed if there is a ../ (cd-up) in the path of -a or (generate-model).

This will fail with:

info: AMF ready. info: Running API parser... undefined

Error at s9a.d.ZQ (/usr/lib/node_modules/api-console-cli/node_modules/amf-client-js/amf.js:1677:195) at s9a.d.ge (/usr/lib/node_modules/api-console-cli/node_modules/amf-client-js/amf.js:1687:187) at s9a.d.tl (/usr/lib/node_modules/api-console-cli/node_modules/amf-client-js/amf.js:4188:358) at r9a.d.pu (/usr/lib/node_modules/api-console-cli/node_modules/amf-client-js/amf.js:3539:158) at r9a.d.gb (/usr/lib/node_modules/api-console-cli/node_modules/amf-client-js/amf.js:3539:246) at r9a.d.U (/usr/lib/node_modules/api-console-cli/node_modules/amf-client-js/amf.js:2292:374) at ne.d.dwa (/usr/lib/node_modules/api-console-cli/node_modules/amf-client-js/amf.js:4083:212) at /usr/lib/node_modules/api-console-cli/node_modules/amf-client-js/amf.js:1013:267 at u.U (/usr/lib/node_modules/api-console-cli/node_modules/amf-client-js/amf.js:2281:216) at /usr/lib/node_modules/api-console-cli/node_modules/amf-client-js/amf.js:2258:317

jarrodek commented 4 years ago

This is now fixed in 2.0.1.

It works with a command like:

api-console build -t "RAML 1.0" ../arc/drive-raml-api-v2/api.raml