Claus Ibsen created CAMEL-20944:
-----------------------------------
Summary: camel-jbang - Generate plugin should validate file exists
Key: CAMEL-20944
URL: https://issues.apache.org/jira/browse/CAMEL-20944
Project: Camel
Issue Type: Improvement
Components: camel-jbang
Reporter: Claus Ibsen
Fix For: 4.8.0
You get a stracktrace, lets improve this to a nicer system error instead
~/workspace/camel-kamelets-examples/jbang/open-api main *1 ❯ camel generate
rest --input=greeting.json --output=code --dto
java.lang.IllegalArgumentException: document must be specified
at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:153)
at
org.apache.camel.generator.openapi.RestDslGenerator.<init>(RestDslGenerator.java:54)
at
org.apache.camel.generator.openapi.RestDslYamlGenerator.<init>(RestDslYamlGenerator.java:65)
at
org.apache.camel.generator.openapi.RestDslGenerator.toYaml(RestDslGenerator.java:240)
at
org.apache.camel.dsl.jbang.core.commands.generate.CodeRestGenerator.doCall(CodeRestGenerator.java:86)
at
org.apache.camel.dsl.jbang.core.commands.CamelCommand.call(CamelCommand.java:71)
at
org.apache.camel.dsl.jbang.core.commands.CamelCommand.call(CamelCommand.java:37)
at picocli.CommandLine.executeUserObject(CommandLine.java:2045)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at
picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2465)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2457)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2419)
at
picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2421)
at picocli.CommandLine.execute(CommandLine.java:2174)
at
org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:168)
at
org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:61)
at main.CamelJBang.main(CamelJBang.java:36)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)