You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ma...@apache.org on 2022/04/21 15:43:40 UTC

[camel] branch main updated: CAMEL-18001. Support route generation from OpenAPi in jbang (#7482)

This is an automated email from the ASF dual-hosted git repository.

marat pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new ce9c61099b8 CAMEL-18001. Support route generation from OpenAPi in jbang (#7482)
ce9c61099b8 is described below

commit ce9c61099b83623eb9a9decff47a10a7ce774ce0
Author: Marat Gubaidullin <ma...@gmail.com>
AuthorDate: Thu Apr 21 11:43:30 2022 -0400

    CAMEL-18001. Support route generation from OpenAPi in jbang (#7482)
    
    * Support route generation from OpenAPi in jbang
    
    * Fix checkstyle
---
 .../org/apache/camel/dsl/jbang/core/commands/CodeRestGenerator.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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 49e4ec8c88f..885e4733116 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
@@ -42,6 +42,8 @@ public class CodeRestGenerator implements Callable<Integer> {
     private String output;
     @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;
 
     @Override
     public Integer call() throws Exception {
@@ -51,7 +53,7 @@ public class CodeRestGenerator implements Callable<Integer> {
         Configurator.setRootLevel(Level.OFF);
         try (CamelContext context = new LightweightCamelContext()) {
             final String yaml = type.equals("yaml")
-                    ? RestDslGenerator.toYaml(document).generate(context)
+                    ? RestDslGenerator.toYaml(document).generate(context, generateRoutes)
                     : RestDslGenerator.toXml(document).generate(context);
             if (output == null) {
                 System.out.println(yaml);