Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create a specific var for custom template and update generators #710

Merged
merged 2 commits into from
Jun 26, 2020

Conversation

HugoMario
Copy link
Contributor

No description provided.

@HugoMario HugoMario self-assigned this Jun 26, 2020
@Grandolf49
Copy link

@HugoMario In what release is this solved? I tried using 3.0.18 and facing the following error.

Exception in thread "Thread-0" java.lang.RuntimeException: Could not generate model 'AccountingRuleData'
        at io.swagger.codegen.v3.DefaultGenerator.generateModels(DefaultGenerator.java:451)
        at io.swagger.codegen.v3.DefaultGenerator.generate(DefaultGenerator.java:779)
        at io.swagger.codegen.v3.cli.cmd.Generate.run(Generate.java:360)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.io.FileNotFoundException: /fineract-provider/config/swagger/templates/model.mustache
        at com.github.jknack.handlebars.io.URLTemplateLoader.sourceAt(URLTemplateLoader.java:70)
        at com.github.jknack.handlebars.Handlebars.compile(Handlebars.java:438)
        at com.github.jknack.handlebars.Handlebars.compile(Handlebars.java:419)
        at io.swagger.codegen.v3.templates.HandlebarTemplateEngine.getHandlebars(HandlebarTemplateEngine.java:48)
        at io.swagger.codegen.v3.templates.HandlebarTemplateEngine.getRendered(HandlebarTemplateEngine.java:24)
        at io.swagger.codegen.v3.DefaultGenerator.processTemplateToFile(DefaultGenerator.java:795)
        at io.swagger.codegen.v3.DefaultGenerator.generateModels(DefaultGenerator.java:438)

In version 3.0.21 I am getting this error

[Thread-0] ERROR i.s.parser.SwaggerCompatConverter - failed to read resource listing
com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'openapi': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
 at [Source: (StringReader); line: 1, column: 8]
        at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1840)
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:722)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._reportInvalidToken(ReaderBasedJsonParser.java:2867)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1913)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:772)
        at com.fasterxml.jackson.databind.ObjectMapper._readTreeAndClose(ObjectMapper.java:4247)
        at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:2720)
        at io.swagger.parser.SwaggerCompatConverter.readResourceListing(SwaggerCompatConverter.java:210)
        at io.swagger.parser.SwaggerCompatConverter.read(SwaggerCompatConverter.java:123)
        at io.swagger.parser.SwaggerCompatConverter.readWithInfo(SwaggerCompatConverter.java:94)
        at io.swagger.parser.SwaggerParser.readWithInfo(SwaggerParser.java:42)
        at io.swagger.v3.parser.converter.SwaggerConverter.readLocation(SwaggerConverter.java:89)
        at io.swagger.parser.OpenAPIParser.readLocation(OpenAPIParser.java:16)
        at io.swagger.codegen.v3.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:517)
        at io.swagger.codegen.v3.cli.cmd.Generate.run(Generate.java:376)
        at java.base/java.lang.Thread.run(Thread.java:834)
Exception in thread "Thread-0" java.lang.RuntimeException: missing OpenAPI input!
        at io.swagger.codegen.v3.DefaultGenerator.generate(DefaultGenerator.java:768)
        at io.swagger.codegen.v3.cli.cmd.Generate.run(Generate.java:378)
        at java.base/java.lang.Thread.run(Thread.java:834)

It says my OpenAPI File is invalid but 3.0.18 is able to build the library (when templateDir is not specified)

Any idea how to resolve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants