openapi-contrib / openapi3-generator

Use your API OpenAPI 3 definition to generate code, documentation, and literally anything you need.
Apache License 2.0
90 stars 27 forks source link

Parser error just gives "oops" #8

Closed philsturgeon closed 5 years ago

philsturgeon commented 6 years ago
Aaww 💩. Something went wrong:
Error: Lexical error on line 1. Unrecognized text.
Bud1
^
    at Parser.parseError (/Users/phil.sturgeon/src/we-sdk-generator/node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js:268:19)
    at Object.parseError (/Users/phil.sturgeon/src/we-sdk-generator/node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js:395:36)
    at Object.next (/Users/phil.sturgeon/src/we-sdk-generator/node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js:523:33)
    at Object.lex (/Users/phil.sturgeon/src/we-sdk-generator/node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js:527:30)
    at lex (/Users/phil.sturgeon/src/we-sdk-generator/node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js:298:36)
    at Parser.parse (/Users/phil.sturgeon/src/we-sdk-generator/node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js:321:34)
    at HandlebarsEnvironment.parse (/Users/phil.sturgeon/src/we-sdk-generator/node_modules/handlebars/dist/cjs/handlebars/compiler/base.js:46:43)
    at compileInput (/Users/phil.sturgeon/src/we-sdk-generator/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:515:19)
    at ret (/Users/phil.sturgeon/src/we-sdk-generator/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:524:18)
    at fs.readFile (/Users/phil.sturgeon/src/we-sdk-generator/node_modules/openapi3-generator/lib/generator.js:46:30)

Love the poop emoji, but I need to know what went wrong, and where.

philsturgeon commented 6 years ago

I searched for Bud1 and didn't find it anywhere.

fmvilas commented 6 years ago

Is it happening with any OpenAPI definition? Can you give me an example of a document so I can reproduce the error?

fmvilas commented 6 years ago

I've been investigating a bit and seems to be related to Handlebars templates. Are you using your own template? Check this question on Stack Overflow, it might help: https://stackoverflow.com/questions/49026236/handlebars-lexical-error-due-to-white-space-that-doesnt-exist.