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

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

commit 2c09d7eebac31cc1622899211c9ba9fc902593c3
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Wed Apr 3 12:35:15 2024 +0200

    CAMEL-20557: Rest DSL to use openapi spec directly
---
 .../java/org/apache/camel/reifier/rest/RestBindingReifier.java     | 5 +++--
 .../org/apache/camel/support/processor/RestBindingFactory.java     | 7 +++++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git 
a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/rest/RestBindingReifier.java
 
b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/rest/RestBindingReifier.java
index e7dcb142e30..d970a34fde3 100644
--- 
a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/rest/RestBindingReifier.java
+++ 
b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/rest/RestBindingReifier.java
@@ -65,12 +65,13 @@ public class RestBindingReifier extends AbstractReifier {
             validation = parseBoolean(definition.getClientRequestValidation(), 
false);
         }
         rbc.setClientRequestValidation(validation);
-        rbc.setRequiredBody(definition.getRequiredBody() != null && 
definition.getRequiredBody());
         rbc.setConsumes(parseString(definition.getConsumes()));
         rbc.setProduces(parseString(definition.getProduces()));
         rbc.setCorsHeaders(config.getCorsHeaders());
-        
rbc.setRequiredQueryParameters(definition.getRequiredQueryParameters());
         rbc.setQueryDefaultValues(definition.getDefaultValues());
+        rbc.setRequiredBody(definition.getRequiredBody() != null && 
definition.getRequiredBody());
+        
rbc.setRequiredQueryParameters(definition.getRequiredQueryParameters());
+        rbc.setRequiredHeaders(definition.getRequiredHeaders());
         rbc.setType(parseString(definition.getType()));
         rbc.setTypeClass(definition.getTypeClass());
         rbc.setOutType(parseString(definition.getOutType()));
diff --git 
a/core/camel-support/src/main/java/org/apache/camel/support/processor/RestBindingFactory.java
 
b/core/camel-support/src/main/java/org/apache/camel/support/processor/RestBindingFactory.java
index a6a387680d1..bc08105e61b 100644
--- 
a/core/camel-support/src/main/java/org/apache/camel/support/processor/RestBindingFactory.java
+++ 
b/core/camel-support/src/main/java/org/apache/camel/support/processor/RestBindingFactory.java
@@ -32,6 +32,13 @@ import org.apache.camel.support.PropertyBindingSupport;
  */
 public class RestBindingFactory {
 
+    /**
+     * Builds the {@link RestBindingSupport} from the given configuration
+     *
+     * @param camelContext the camel context
+     * @param bc           the binding configuration
+     * @return             the created binding advice
+     */
     public static RestBindingSupport build(CamelContext camelContext, 
RestBindingConfiguration bc) throws Exception {
         String mode = bc.getBindingMode();
 

Reply via email to