This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-3.20.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.20.x by this push:
new 880b7760512 CAMEL-19231: Default REST DSL type in camel-jbang
generator (#9740)
880b7760512 is described below
commit 880b7760512727bcd6b0499527946461d1350257
Author: Marat Gubaidullin <[email protected]>
AuthorDate: Fri Mar 31 10:32:25 2023 -0400
CAMEL-19231: Default REST DSL type in camel-jbang generator (#9740)
* Implements CAMEL-19231
* Format imports
---
.../org/apache/camel/dsl/jbang/core/commands/CodeRestGenerator.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/CodeRestGenerator.java
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/CodeRestGenerator.java
index 2da2829ef68..31431befa54 100644
---
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/CodeRestGenerator.java
+++
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/CodeRestGenerator.java
@@ -50,7 +50,7 @@ public class CodeRestGenerator extends CamelCommand {
private String input;
@CommandLine.Option(names = { "-o", "--output" }, description = "Output
REST DSL file name")
private String output;
- @CommandLine.Option(names = { "-t", "--type" }, description = "REST DSL
type (YAML or XML)")
+ @CommandLine.Option(names = { "-t", "--type" }, description = "REST DSL
type (YAML or XML)", defaultValue = "yaml")
private String type;
@CommandLine.Option(names = { "-r", "--routes" }, description = "Generate
routes (YAML)")
private boolean generateRoutes;
@@ -73,9 +73,9 @@ public class CodeRestGenerator extends CamelCommand {
Configurator.setRootLevel(Level.OFF);
try (CamelContext context = new LightweightCamelContext()) {
String text = null;
- if (type.equalsIgnoreCase("yaml")) {
+ if ("yaml".equalsIgnoreCase(type)) {
text = RestDslGenerator.toYaml(document).generate(context,
generateRoutes);
- } else if (type.equalsIgnoreCase("xml")) {
+ } else if ("xml".equalsIgnoreCase(type)) {
text = RestDslGenerator.toXml(document).generate(context);
}
if (text != null) {