You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2022/07/26 11:25:24 UTC

[camel] 01/02: CAMEL-18306: camel-jbang - Allow to specify open-api in application.properties

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

davsclaus pushed a commit to branch camel-3.18.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 9f1bb355a1a613c5ecdd783c5d1183729564656a
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Jul 26 12:55:41 2022 +0200

    CAMEL-18306: camel-jbang - Allow to specify open-api in application.properties
---
 .../java/org/apache/camel/dsl/jbang/core/commands/Run.java    | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
index c8a714a41fd..868eaeb6f43 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
@@ -275,11 +275,6 @@ class Run extends CamelCommand {
         removeDir(work);
         work.mkdirs();
 
-        // generate open-api early
-        if (openapi != null) {
-            generateOpenApi();
-        }
-
         Properties profileProperties = null;
         File profilePropertiesFile = new File(getProfile() + ".properties");
         if (profilePropertiesFile.exists()) {
@@ -296,9 +291,15 @@ class Run extends CamelCommand {
                 propertiesFiles = propertiesFiles + ",file:" + profilePropertiesFile.getName();
             }
             repos = profileProperties.getProperty("camel.jbang.repos", repos);
+            openapi = profileProperties.getProperty("camel.jbang.open-api", openapi);
             download = "true".equals(profileProperties.getProperty("camel.jbang.download", download ? "true" : "false"));
         }
 
+        // generate open-api early
+        if (openapi != null) {
+            generateOpenApi();
+        }
+
         // if no specific file to run then try to auto-detect
         if (files == null || files.length == 0) {
             String routes = profileProperties != null ? profileProperties.getProperty("camel.main.routesIncludePattern") : null;