api-spec-converter
api-spec-converter copied to clipboard
Fatal error during converting from RAML
Hello,
I have tried converting RAML file and have got this problem.
api-spec-converter /home/user/api.raml --from=raml --to=swagger_2 > result.json Fatal AssertionError: undefined == true at /usr/local/lib/node_modules/api-spec-converter/node_modules/raml-to-swagger/src/index.js:113:7 at /usr/local/lib/node_modules/api-spec-converter/node_modules/lodash/lodash.js:4944:15 at baseForOwn (/usr/local/lib/node_modules/api-spec-converter/node_modules/lodash/lodash.js:3001:24) at /usr/local/lib/node_modules/api-spec-converter/node_modules/lodash/lodash.js:4913:18 at Function.forEach (/usr/local/lib/node_modules/api-spec-converter/node_modules/lodash/lodash.js:9359:14) at /usr/local/lib/node_modules/api-spec-converter/node_modules/raml-to-swagger/src/index.js:101:7 at arrayEach (/usr/local/lib/node_modules/api-spec-converter/node_modules/lodash/lodash.js:537:11) at Function.forEach (/usr/local/lib/node_modules/api-spec-converter/node_modules/lodash/lodash.js:9359:14) at parseSecuritySchemes (/usr/local/lib/node_modules/api-spec-converter/node_modules/raml-to-swagger/src/index.js:100:5) at Object.exports.convert (/usr/local/lib/node_modules/api-spec-converter/node_modules/raml-to-swagger/src/index.js:20:26) at converters.swagger_2.Promise.method.raml (/usr/local/lib/node_modules/api-spec-converter/lib/formats/raml.js:17:41) at tryCatcher (/usr/local/lib/node_modules/api-spec-converter/node_modules/bluebird/js/release/util.js:16:23) at /usr/local/lib/node_modules/api-spec-converter/node_modules/bluebird/js/release/method.js:15:34 at Promise.try (/usr/local/lib/node_modules/api-spec-converter/lib/base_format.js:105:12) at tryCatcher (/usr/local/lib/node_modules/api-spec-converter/node_modules/bluebird/js/release/util.js:16:23) at Function.Promise.attempt.Promise.try (/usr/local/lib/node_modules/api-spec-converter/node_modules/bluebird/js/release/method.js:39:29)
Could you upload the RAML definition to a gist? If not the whole file, then the securitySchemes section?
Possibly related to https://github.com/APIs-guru/raml-to-swagger/pull/1
@MikeRalphson , https://gist.github.com/serezha93/7e6f103b9e50950dcf1c3000c7174797
Thanks @serezha93 - does security/session.yml include a type: beginning x- ?
@MikeRalphson , yep. You'are right about this. And I have read request for PR you give here. It's my case.
It will be great if you complete this PR if not I can finish it for you this week.
As I understood it wasn't realized : (
@serezha93 I have asked the author of the PR whether he is still interested in progressing it. If not I will attempt to finish it, but it wouldn't be before next week.
One thing you could try is commenting out lines 24 and 28 from your RAML definition and see if there are other problems. You would need to rebuild the missing session securityDefinition in the swagger output file by hand.