You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2020/07/09 13:28:20 UTC
[camel-k-runtime] branch master updated: Generate schema for YAML
DSL #358
This is an automated email from the ASF dual-hosted git repository.
lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git
The following commit(s) were added to refs/heads/master by this push:
new 892702c Generate schema for YAML DSL #358
892702c is described below
commit 892702c5f4f3dc81bc4efb4092b21bab9cab761e
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Wed Jun 24 17:05:08 2020 +0200
Generate schema for YAML DSL #358
---
.../k/loader/yaml/parser/AggregateStepParser.java | 4 +-
.../k/loader/yaml/parser/ChoiceStepParser.java | 9 +-
.../yaml/parser/CircuitBreakerStepParser.java | 10 +-
.../k/loader/yaml/parser/DelayStepParser.java | 2 +-
.../k/loader/yaml/parser/DoTryStepParser.java | 12 +-
.../yaml/parser/DynamicRouterStepParser.java | 2 +-
.../k/loader/yaml/parser/EnrichStepParser.java | 6 +-
.../loader/yaml/parser/ErrorHandlerStepParser.java | 10 +-
.../k/loader/yaml/parser/FilterStepParser.java | 4 +-
.../camel/k/loader/yaml/parser/FromStepParser.java | 10 +-
.../yaml/parser/IdempotentConsumerParser.java | 4 +-
.../loader/yaml/parser/LoadBalanceStepParser.java | 9 +-
.../camel/k/loader/yaml/parser/LoopStepParser.java | 4 +-
.../k/loader/yaml/parser/MarshalStepParser.java | 2 +-
.../k/loader/yaml/parser/MulticastStepParser.java | 4 +-
.../loader/yaml/parser/OnExceptionStepParser.java | 10 +-
.../k/loader/yaml/parser/PipelineStepParser.java | 4 +-
.../k/loader/yaml/parser/PollEnrichStepParser.java | 2 +-
.../k/loader/yaml/parser/ProcessStepParser.java | 10 +-
.../yaml/parser/RecipientListStepParser.java | 2 +-
.../k/loader/yaml/parser/ResequenceStepParser.java | 4 +-
.../camel/k/loader/yaml/parser/RestStepParser.java | 2 +-
.../k/loader/yaml/parser/RouteStepParser.java | 98 +-
.../loader/yaml/parser/RoutingSlipStepParser.java | 2 +-
.../camel/k/loader/yaml/parser/SagaStepParser.java | 4 +-
.../k/loader/yaml/parser/SampleStepParser.java | 4 +-
.../k/loader/yaml/parser/ScriptStepParser.java | 2 +-
.../loader/yaml/parser/ServiceCallStepParser.java | 5 +-
.../k/loader/yaml/parser/SetBodyStepParser.java | 2 +-
.../yaml/parser/SetExchangePatternStepParser.java | 10 +-
.../k/loader/yaml/parser/SetHeaderStepParser.java | 2 +-
.../loader/yaml/parser/SetPropertyStepParser.java | 2 +-
.../camel/k/loader/yaml/parser/SortStepParser.java | 2 +-
.../k/loader/yaml/parser/SplitStepParser.java | 4 +-
.../camel/k/loader/yaml/parser/StepStepParser.java | 4 +-
.../k/loader/yaml/parser/ThrottleStepParser.java | 2 +-
.../yaml/parser/ThrowExceptionStepParser.java | 10 +-
.../k/loader/yaml/parser/ToDynamicStepParser.java | 4 +-
.../camel/k/loader/yaml/parser/ToStepParser.java | 4 +-
.../k/loader/yaml/parser/TransactedStepParser.java | 10 +-
.../k/loader/yaml/parser/TransformStepParser.java | 2 +-
.../yaml/parser/TypedProcessorStepParser.java | 1 -
.../k/loader/yaml/parser/UnmarshalStepParser.java | 2 +-
.../k/loader/yaml/parser/ValidateStepParser.java | 2 +-
.../k/loader/yaml/parser/WireTapStepParser.java | 3 +-
.../yaml/support/RemoveHeaderDefinitionMixIn.java | 4 +-
.../support/RemovePropertyDefinitionMixIn.java | 4 +-
.../pom.xml | 96 +-
camel-k-loader-yaml/camel-k-loader-yaml/pom.xml | 43 +-
.../src/generated/resources/yaml-schema.json | 3762 ++++++++++++++++++++
.../camel/k/loader/yaml/DefinitionsTest.groovy | 31 +-
.../apache/camel/k/loader/yaml/RoutesTest.groovy | 11 +
.../k/loader/yaml/parser/CircuitBreakerTest.groovy | 15 -
.../yaml/support/MyUppercaseProcessor.groovy | 17 +-
.../src/test/resources/routes/RoutesTest_bean.yaml | 13 +-
camel-k-loader-yaml/pom.xml | 1 +
.../src/test/resources/routes.yaml | 4 +-
.../src/test/resources/routes.yaml | 8 +-
camel-k-runtime-bom/pom.xml | 5 +
.../knative/yaml/parser/KnativeConverterTest.java | 10 -
.../src/test/resources/route.yaml | 21 +-
pom.xml | 5 +
.../camel/k/annotation/yaml/YAMLStepParser.java | 3 +-
.../maven/GenerateYamlLoaderSupportClasses.java | 40 +-
.../maven/GenerateYamlParserSupportClasses.java | 10 +-
.../camel/k/tooling/maven/GenerateYamlSchema.java | 556 +++
.../camel/k/tooling/maven/GenerateYamlSupport.java | 171 +-
.../k/tooling/maven/support/IndexerSupport.java | 114 +
.../k/tooling/maven/support/MavenSupport.java | 47 +
69 files changed, 4938 insertions(+), 360 deletions(-)
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/AggregateStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/AggregateStepParser.java
index 61c8745..92dfbd5 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/AggregateStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/AggregateStepParser.java
@@ -17,6 +17,7 @@
package org.apache.camel.k.loader.yaml.parser;
import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.camel.Expression;
import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
@@ -27,7 +28,7 @@ import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.language.ExpressionDefinition;
import org.apache.camel.reifier.AggregateReifier;
-@YAMLStepParser("aggregate")
+@YAMLStepParser(id = "aggregate", definitions = AggregateStepParser.Definition.class)
public class AggregateStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
@@ -41,6 +42,7 @@ public class AggregateStepParser implements ProcessorStepParser {
super.setExpression(expression);
}
+ @JsonProperty
public void setCorrelationExpression(CorrelationExpression correlationExpression) {
super.setCorrelationExpression(correlationExpression);
}
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ChoiceStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ChoiceStepParser.java
index 4685cd3..b895493 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ChoiceStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ChoiceStepParser.java
@@ -18,6 +18,7 @@ package org.apache.camel.k.loader.yaml.parser;
import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
import org.apache.camel.k.loader.yaml.model.Step;
@@ -28,7 +29,7 @@ import org.apache.camel.model.OtherwiseDefinition;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.WhenDefinition;
-@YAMLStepParser("choice")
+@YAMLStepParser(id = "choice", definitions = ChoiceStepParser.Definition.class)
public class ChoiceStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
@@ -62,14 +63,20 @@ public class ChoiceStepParser implements ProcessorStepParser {
@YAMLNodeDefinition
public static final class Definition {
+ @JsonProperty
public List<When> when;
+ @JsonProperty
public Otherwise otherwise;
+ @YAMLNodeDefinition
public static final class When extends WhenDefinition implements HasExpression {
+ @JsonProperty
public List<Step> steps;
}
+ @YAMLNodeDefinition
public static final class Otherwise extends OtherwiseDefinition {
+ @JsonProperty
public List<Step> steps;
}
}
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/CircuitBreakerStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/CircuitBreakerStepParser.java
index 0386d20..3bb2d42 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/CircuitBreakerStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/CircuitBreakerStepParser.java
@@ -19,6 +19,7 @@ package org.apache.camel.k.loader.yaml.parser;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonAlias;
+import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
import org.apache.camel.k.loader.yaml.model.Step;
@@ -33,7 +34,7 @@ import org.apache.camel.model.Resilience4jConfigurationDefinition;
import org.apache.camel.reifier.CircuitBreakerReifier;
import org.apache.camel.reifier.OnFallbackReifier;
-@YAMLStepParser("circuit-breaker")
+@YAMLStepParser(id = "circuit-breaker", definitions = CircuitBreakerStepParser.CBDefinition.class)
public class CircuitBreakerStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
@@ -61,8 +62,9 @@ public class CircuitBreakerStepParser implements ProcessorStepParser {
@YAMLNodeDefinition(reifiers = CircuitBreakerReifier.class)
public static final class CBDefinition {
public CircuitBreakerDefinition delegate = new CircuitBreakerDefinition();
- public FBDefinition onFallback;
+ public FBDefinition onFallback;
+ @JsonProperty
public List<Step> steps;
public HystrixConfigurationDefinition getHystrixConfiguration() {
@@ -93,6 +95,7 @@ public class CircuitBreakerStepParser implements ProcessorStepParser {
return onFallback;
}
+ @JsonProperty("on-fallback")
public void setOnFallback(FBDefinition onFallback) {
this.onFallback = onFallback;
}
@@ -100,6 +103,7 @@ public class CircuitBreakerStepParser implements ProcessorStepParser {
@YAMLNodeDefinition(reifiers = OnFallbackReifier.class)
public static final class FBDefinition extends OnFallbackDefinition {
+ @JsonProperty
public List<Step> steps;
@Override
@@ -107,7 +111,7 @@ public class CircuitBreakerStepParser implements ProcessorStepParser {
return super.getFallbackViaNetwork();
}
- @JsonAlias({"fallback-via-network", "via-network"})
+ @JsonAlias("fallback-via-network")
@Override
public void setFallbackViaNetwork(String fallbackViaNetwork) {
super.setFallbackViaNetwork(fallbackViaNetwork);
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/DelayStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/DelayStepParser.java
index 9aac940..a372828 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/DelayStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/DelayStepParser.java
@@ -23,7 +23,7 @@ import org.apache.camel.model.DelayDefinition;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.reifier.DelayReifier;
-@YAMLStepParser("delay")
+@YAMLStepParser(id = "delay", definitions = DelayStepParser.Definition.class)
public class DelayStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/DoTryStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/DoTryStepParser.java
index d164b42..249b78c 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/DoTryStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/DoTryStepParser.java
@@ -19,6 +19,7 @@ package org.apache.camel.k.loader.yaml.parser;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonAlias;
+import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
import org.apache.camel.k.loader.yaml.model.Step;
@@ -33,7 +34,7 @@ import org.apache.camel.reifier.CatchReifier;
import org.apache.camel.reifier.FinallyReifier;
import org.apache.camel.reifier.TryReifier;
-@YAMLStepParser("do-try")
+@YAMLStepParser(id = "do-try", definitions = DoTryStepParser.DoTryDefinition.class)
public class DoTryStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
@@ -86,20 +87,23 @@ public class DoTryStepParser implements ProcessorStepParser {
@YAMLNodeDefinition(reifiers = TryReifier.class)
public static final class DoTryDefinition {
public TryDefinition delegate = new TryDefinition();
+ @JsonProperty
public List<Step> steps;
- @JsonAlias({"do-catch"})
+ @JsonAlias("do-catch")
public DoCatchDefinition doCatch;
- @JsonAlias({"do-finally"})
+ @JsonAlias("do-finally")
public DoFinallyDefinition doFinally;
}
@YAMLNodeDefinition(reifiers = CatchReifier.class)
public static final class DoCatchDefinition extends CatchDefinition {
- @JsonAlias({"when"})
+ @JsonAlias("do-when")
public When when;
+ @JsonProperty
public List<Step> steps;
public static final class When extends WhenDefinition implements HasExpression {
+ @JsonProperty
public List<Step> steps;
}
}
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/DynamicRouterStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/DynamicRouterStepParser.java
index 4974d78..88a65a9 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/DynamicRouterStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/DynamicRouterStepParser.java
@@ -23,7 +23,7 @@ import org.apache.camel.model.DynamicRouterDefinition;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.reifier.DynamicRouterReifier;
-@YAMLStepParser("dynamic-router")
+@YAMLStepParser(id = "dynamic-router", definitions = DynamicRouterStepParser.Definition.class)
public class DynamicRouterStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/EnrichStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/EnrichStepParser.java
index 997351f..d3e0948 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/EnrichStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/EnrichStepParser.java
@@ -17,6 +17,7 @@
package org.apache.camel.k.loader.yaml.parser;
import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.camel.Expression;
import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
@@ -25,7 +26,7 @@ import org.apache.camel.model.EnrichDefinition;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.reifier.EnrichReifier;
-@YAMLStepParser("enrich")
+@YAMLStepParser(id = "enrich", definitions = EnrichStepParser.Definition.class)
public class EnrichStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
@@ -39,11 +40,12 @@ public class EnrichStepParser implements ProcessorStepParser {
super.setExpression(expression);
}
+ @JsonProperty("strategy-ref")
public void setStrategyRef(String aggregationStrategyRef) {
super.setAggregationStrategyRef(aggregationStrategyRef);
}
- public String getStrategyMethodName() {
+ public String getStrategyRef() {
return super.getAggregationStrategyRef();
}
}
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ErrorHandlerStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ErrorHandlerStepParser.java
index ea93135..fff1a2c 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ErrorHandlerStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ErrorHandlerStepParser.java
@@ -22,6 +22,7 @@ import org.apache.camel.builder.DefaultErrorHandlerBuilder;
import org.apache.camel.builder.ErrorHandlerBuilder;
import org.apache.camel.builder.ErrorHandlerBuilderRef;
import org.apache.camel.builder.NoErrorHandlerBuilder;
+import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
import org.apache.camel.k.loader.yaml.spi.ProcessorStepParser;
import org.apache.camel.k.loader.yaml.spi.StartStepParser;
@@ -29,7 +30,7 @@ import org.apache.camel.k.loader.yaml.spi.StepParserSupport;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.RouteDefinition;
-@YAMLStepParser("error-handler")
+@YAMLStepParser(id = "error-handler", definitions = ErrorHandlerStepParser.Definition.class)
public class ErrorHandlerStepParser implements StartStepParser, ProcessorStepParser {
@Override
public ProcessorDefinition<?> toStartProcessor(Context context) {
@@ -52,6 +53,7 @@ public class ErrorHandlerStepParser implements StartStepParser, ProcessorStepPar
return context.processor(RouteDefinition.class).errorHandler(definition.builder);
}
+ @YAMLNodeDefinition()
public static final class Definition {
public ErrorHandlerBuilder builder;
@@ -65,14 +67,14 @@ public class ErrorHandlerStepParser implements StartStepParser, ProcessorStepPar
setBuilder(builder);
}
- @JsonAlias({"no-error-handler", "none" })
+ @JsonAlias("no-error-handler")
public void setNoErrorHandler(NoErrorHandlerBuilder builder) {
setBuilder(builder);
}
@JsonAlias("ref")
- public void setRefHandler(ErrorHandlerBuilderRef builder) {
- setBuilder(builder);
+ public void setRefHandler(String ref) {
+ setBuilder(new ErrorHandlerBuilderRef(ref));
}
private void setBuilder(ErrorHandlerBuilder builder) {
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/FilterStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/FilterStepParser.java
index 90af676..e23afc1 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/FilterStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/FilterStepParser.java
@@ -18,6 +18,7 @@ package org.apache.camel.k.loader.yaml.parser;
import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
import org.apache.camel.k.loader.yaml.model.Step;
@@ -27,7 +28,7 @@ import org.apache.camel.model.FilterDefinition;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.reifier.FilterReifier;
-@YAMLStepParser("filter")
+@YAMLStepParser(id = "filter", definitions = FilterStepParser.Definition.class)
public class FilterStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
@@ -42,6 +43,7 @@ public class FilterStepParser implements ProcessorStepParser {
@YAMLNodeDefinition(reifiers = FilterReifier.class)
public static final class Definition extends FilterDefinition implements HasExpression {
+ @JsonProperty
public List<Step> steps;
}
}
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/FromStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/FromStepParser.java
index 47e95fc..e517763 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/FromStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/FromStepParser.java
@@ -22,6 +22,7 @@ import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
import org.apache.camel.k.loader.yaml.model.Step;
@@ -31,11 +32,11 @@ import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.RouteDefinition;
import org.apache.camel.util.URISupport;
-@YAMLStepParser("from")
+@YAMLStepParser(id = "from", definitions = FromStepParser.Definition.class)
public class FromStepParser implements StartStepParser {
@Override
public ProcessorDefinition<?> toStartProcessor(Context context) {
- final FromStepDefinition definition = context.node(FromStepDefinition.class);
+ final Definition definition = context.node(Definition.class);
final String uri = definition.getEndpointUri();
final RouteDefinition route = context.builder().from(uri);
@@ -50,9 +51,12 @@ public class FromStepParser implements StartStepParser {
}
@YAMLNodeDefinition
- public static final class FromStepDefinition {
+ public static final class Definition {
+ @JsonProperty(required = true)
public String uri;
+ @JsonProperty
public Map<String, Object> parameters;
+ @JsonProperty(required = true)
public List<Step> steps;
@JsonIgnore
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/IdempotentConsumerParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/IdempotentConsumerParser.java
index fb90ed1..aa6ff77 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/IdempotentConsumerParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/IdempotentConsumerParser.java
@@ -18,6 +18,7 @@ package org.apache.camel.k.loader.yaml.parser;
import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
import org.apache.camel.k.loader.yaml.model.Step;
@@ -27,7 +28,7 @@ import org.apache.camel.model.IdempotentConsumerDefinition;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.reifier.IdempotentConsumerReifier;
-@YAMLStepParser("idempotent-consumer")
+@YAMLStepParser(id = "idempotent-consumer", definitions = IdempotentConsumerParser.Definition.class)
public class IdempotentConsumerParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
@@ -42,6 +43,7 @@ public class IdempotentConsumerParser implements ProcessorStepParser {
@YAMLNodeDefinition(reifiers = IdempotentConsumerReifier.class)
public static final class Definition extends IdempotentConsumerDefinition implements HasExpression {
+ @JsonProperty
public List<Step> steps;
}
}
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/LoadBalanceStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/LoadBalanceStepParser.java
index d27983e..9f854c8 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/LoadBalanceStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/LoadBalanceStepParser.java
@@ -20,6 +20,7 @@ import java.util.List;
import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import org.apache.camel.Expression;
import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
@@ -41,7 +42,7 @@ import org.apache.camel.model.loadbalancer.TopicLoadBalancerDefinition;
import org.apache.camel.model.loadbalancer.WeightedLoadBalancerDefinition;
import org.apache.camel.reifier.LoadBalanceReifier;
-@YAMLStepParser("load-balance")
+@YAMLStepParser(id = "load-balance", definitions = LoadBalanceStepParser.Definition.class)
public class LoadBalanceStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
@@ -56,9 +57,10 @@ public class LoadBalanceStepParser implements ProcessorStepParser {
@YAMLNodeDefinition(reifiers = LoadBalanceReifier.class)
public static final class Definition extends LoadBalanceDefinition {
+ @JsonProperty
public List<Step> steps;
- @JsonAlias({"load-balancer-type", "type"})
+ @JsonAlias("type")
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.WRAPPER_OBJECT
@@ -81,7 +83,7 @@ public class LoadBalanceStepParser implements ProcessorStepParser {
setLoadBalancerType(definition);
}
- @JsonAlias({"customLoadBalancer", "custom"})
+ @JsonAlias("custom")
public void setCustomLoadBalancer(CustomLoadBalancerDefinition definition) {
if (getLoadBalancerType() != null) {
throw new IllegalArgumentException("A load-balancer has already been set");
@@ -134,6 +136,7 @@ public class LoadBalanceStepParser implements ProcessorStepParser {
setCustomLoadBalancer(definition);
}
+ @YAMLNodeDefinition
public static final class Sticky extends StickyLoadBalancerDefinition implements HasExpression {
@JsonIgnore
@Override
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/LoopStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/LoopStepParser.java
index f6965f4..4a72084 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/LoopStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/LoopStepParser.java
@@ -18,6 +18,7 @@ package org.apache.camel.k.loader.yaml.parser;
import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
import org.apache.camel.k.loader.yaml.model.Step;
@@ -27,7 +28,7 @@ import org.apache.camel.model.LoopDefinition;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.reifier.LoopReifier;
-@YAMLStepParser("loop")
+@YAMLStepParser(id = "loop", definitions = LoopStepParser.Definition.class)
public class LoopStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
@@ -42,6 +43,7 @@ public class LoopStepParser implements ProcessorStepParser {
@YAMLNodeDefinition(reifiers = LoopReifier.class)
public static final class Definition extends LoopDefinition implements HasExpression {
+ @JsonProperty
public List<Step> steps;
}
}
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/MarshalStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/MarshalStepParser.java
index b03f56d..520e4d0 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/MarshalStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/MarshalStepParser.java
@@ -23,7 +23,7 @@ import org.apache.camel.model.MarshalDefinition;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.reifier.MarshalReifier;
-@YAMLStepParser("marshal")
+@YAMLStepParser(id = "marshal", definitions = MarshalStepParser.Definition.class)
public class MarshalStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/MulticastStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/MulticastStepParser.java
index fd237c3..f226900 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/MulticastStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/MulticastStepParser.java
@@ -18,6 +18,7 @@ package org.apache.camel.k.loader.yaml.parser;
import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
import org.apache.camel.k.loader.yaml.model.Step;
@@ -27,7 +28,7 @@ import org.apache.camel.model.MulticastDefinition;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.reifier.MulticastReifier;
-@YAMLStepParser("multicast")
+@YAMLStepParser(id = "multicast", definitions = MulticastStepParser.Definition.class)
public class MulticastStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
@@ -42,6 +43,7 @@ public class MulticastStepParser implements ProcessorStepParser {
@YAMLNodeDefinition(reifiers = MulticastReifier.class)
public static final class Definition extends MulticastDefinition {
+ @JsonProperty
public List<Step> steps;
}
}
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/OnExceptionStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/OnExceptionStepParser.java
index 6e12643..5408414 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/OnExceptionStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/OnExceptionStepParser.java
@@ -19,6 +19,7 @@ package org.apache.camel.k.loader.yaml.parser;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonAlias;
+import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
import org.apache.camel.k.loader.yaml.model.Step;
@@ -36,7 +37,7 @@ import org.apache.camel.reifier.OnExceptionReifier;
import static org.apache.camel.util.ObjectHelper.ifNotEmpty;
-@YAMLStepParser("on-exception")
+@YAMLStepParser(id = "on-exception", definitions = OnExceptionStepParser.Definition.class)
public class OnExceptionStepParser implements StartStepParser, ProcessorStepParser {
@SuppressWarnings("unchecked")
@Override
@@ -106,12 +107,13 @@ public class OnExceptionStepParser implements StartStepParser, ProcessorStepPars
@YAMLNodeDefinition(reifiers = OnExceptionReifier.class)
public static final class Definition {
+ @JsonProperty
public List<Step> steps;
@JsonAlias("exceptions")
public List<String> exceptions;
- @JsonAlias({"when", "on-when"})
+ @JsonAlias("when")
public When onWhen;
@JsonAlias("retry-while")
public ExpressionElement retryWhile;
@@ -134,10 +136,13 @@ public class OnExceptionStepParser implements StartStepParser, ProcessorStepPars
@JsonAlias("use-original-body")
public boolean useOriginalBody;
+ @YAMLNodeDefinition
public static final class When extends WhenDefinition implements HasExpression {
+ @JsonProperty
public List<Step> steps;
}
+ @YAMLNodeDefinition
public static final class ExpressionElement extends ExpressionSubElementDefinition implements HasExpression {
@Override
public void setExpression(ExpressionDefinition expressionDefinition) {
@@ -150,6 +155,7 @@ public class OnExceptionStepParser implements StartStepParser, ProcessorStepPars
}
}
+ @YAMLNodeDefinition
public static final class MaybeBooleanExpressionElement extends ExpressionSubElementDefinition implements HasExpression {
public MaybeBooleanExpressionElement() {
}
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/PipelineStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/PipelineStepParser.java
index dfdb8b1..ce82308 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/PipelineStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/PipelineStepParser.java
@@ -18,6 +18,7 @@ package org.apache.camel.k.loader.yaml.parser;
import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
import org.apache.camel.k.loader.yaml.model.Step;
@@ -26,7 +27,7 @@ import org.apache.camel.k.loader.yaml.spi.StepParserSupport;
import org.apache.camel.model.PipelineDefinition;
import org.apache.camel.model.ProcessorDefinition;
-@YAMLStepParser("pipeline")
+@YAMLStepParser(id = "pipeline", definitions = PipelineStepParser.Definition.class)
public class PipelineStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
@@ -44,6 +45,7 @@ public class PipelineStepParser implements ProcessorStepParser {
@YAMLNodeDefinition
public static final class Definition {
+ @JsonProperty
public List<Step> steps;
}
}
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/PollEnrichStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/PollEnrichStepParser.java
index 4b2f047..ba77c59 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/PollEnrichStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/PollEnrichStepParser.java
@@ -25,7 +25,7 @@ import org.apache.camel.model.PollEnrichDefinition;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.reifier.PollEnrichReifier;
-@YAMLStepParser("poll-enrich")
+@YAMLStepParser(id = "poll-enrich", definitions = PollEnrichStepParser.Definition.class)
public class PollEnrichStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ProcessStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ProcessStepParser.java
index 1e22238..4a008bd 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ProcessStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ProcessStepParser.java
@@ -16,16 +16,22 @@
*/
package org.apache.camel.k.loader.yaml.parser;
+import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
import org.apache.camel.k.loader.yaml.spi.ProcessorStepParser;
import org.apache.camel.model.ProcessDefinition;
import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.reifier.ProcessReifier;
-@YAMLStepParser("process")
+@YAMLStepParser(id = "process", definitions = ProcessStepParser.Definition.class)
public class ProcessStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
- return context.node(ProcessDefinition.class);
+ return context.node(Definition.class);
+ }
+
+ @YAMLNodeDefinition(reifiers = ProcessReifier.class)
+ public static class Definition extends ProcessDefinition {
}
}
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/RecipientListStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/RecipientListStepParser.java
index 4e1d386..104433f 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/RecipientListStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/RecipientListStepParser.java
@@ -23,7 +23,7 @@ import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.RecipientListDefinition;
import org.apache.camel.reifier.RecipientListReifier;
-@YAMLStepParser("recipient-list")
+@YAMLStepParser(id = "recipient-list", definitions = RecipientListStepParser.Definition.class)
public class RecipientListStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ResequenceStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ResequenceStepParser.java
index 6200a2e..c49d7c4 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ResequenceStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ResequenceStepParser.java
@@ -20,6 +20,7 @@ import java.util.List;
import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.camel.Expression;
import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
@@ -32,7 +33,7 @@ import org.apache.camel.model.config.BatchResequencerConfig;
import org.apache.camel.model.config.StreamResequencerConfig;
import org.apache.camel.reifier.ResequenceReifier;
-@YAMLStepParser("resequence")
+@YAMLStepParser(id = "resequence", definitions = ResequenceStepParser.Definition.class)
public class ResequenceStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
@@ -47,6 +48,7 @@ public class ResequenceStepParser implements ProcessorStepParser {
@YAMLNodeDefinition(reifiers = ResequenceReifier.class)
public static final class Definition extends ResequenceDefinition implements HasExpression {
+ @JsonProperty
public List<Step> steps;
@JsonIgnore
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/RestStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/RestStepParser.java
index 936f556..3bdedca 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/RestStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/RestStepParser.java
@@ -31,7 +31,7 @@ import org.apache.camel.model.rest.RestBindingMode;
import org.apache.camel.model.rest.RestDefinition;
import org.apache.camel.util.ObjectHelper;
-@YAMLStepParser("rest")
+@YAMLStepParser(id = "rest", definitions = RestStepParser.Definition.class)
public class RestStepParser implements StartStepParser {
@Override
public ProcessorDefinition<?> toStartProcessor(Context context) {
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/RouteStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/RouteStepParser.java
index c227a32..acb76cc 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/RouteStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/RouteStepParser.java
@@ -16,82 +16,84 @@
*/
package org.apache.camel.k.loader.yaml.parser;
-import java.util.Optional;
+import java.io.UnsupportedEncodingException;
+import java.net.URISyntaxException;
+import java.util.List;
+import java.util.Map;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
-import org.apache.camel.k.loader.yaml.model.Node;
-import org.apache.camel.k.loader.yaml.spi.ProcessorStepParser;
+import org.apache.camel.k.loader.yaml.model.Step;
import org.apache.camel.k.loader.yaml.spi.StartStepParser;
+import org.apache.camel.k.loader.yaml.spi.StepParserSupport;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.RouteDefinition;
+import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.util.URISupport;
-@YAMLStepParser("route")
+@YAMLStepParser(id = "route", definitions = RouteStepParser.Definition.class)
public class RouteStepParser implements StartStepParser {
@Override
public ProcessorDefinition<?> toStartProcessor(Context context) {
final Definition definition = context.node(Definition.class);
+ final String uri = definition.from.getEndpointUri();
+ final RouteDefinition route = context.builder().from(uri);
- final ProcessorDefinition<?> root = StartStepParser.invoke(
- ProcessorStepParser.Context.of(context, definition.getRoot().getData()),
- definition.getRoot().getType());
+ ObjectHelper.ifNotEmpty(definition.id, route::routeId);
+ ObjectHelper.ifNotEmpty(definition.group, route::routeGroup);
- if (root == null) {
- throw new IllegalStateException("No route definition");
- }
- if (!(root instanceof RouteDefinition)) {
- throw new IllegalStateException("Root definition should be of type RouteDefinition");
- }
+ // as this is a start converter, steps are mandatory
+ StepParserSupport.notNull(definition.steps, "steps");
- definition.getId().ifPresent(root::routeId);
- definition.getGroup().ifPresent(root::routeGroup);
-
- return root;
+ return StepParserSupport.convertSteps(
+ context,
+ route,
+ definition.steps
+ );
}
@YAMLNodeDefinition
public static final class Definition {
- private String id;
- private String group;
- private Node root;
-
- public Optional<String> getId() {
- return Optional.ofNullable(id);
- }
-
- public void setId(String id) {
- this.id = id;
- }
+ @JsonProperty
+ public String id;
+ @JsonProperty
+ public String group;
+ @JsonProperty(required = true)
+ public From from;
+ @JsonProperty(required = true)
+ public List<Step> steps;
+ }
- public Optional<String> getGroup() {
- return Optional.ofNullable(group);
- }
+ @YAMLNodeDefinition
+ public static final class From {
+ @JsonProperty
+ public String uri;
+ @JsonProperty
+ public Map<String, Object> parameters;
- public void setGroup(String group) {
- this.group = group;
+ public From() {
}
- @JsonIgnore
- public Node getRoot() {
- return root;
+ public From(String uri) {
+ this.uri = uri;
}
@JsonIgnore
- public void setRoot(Node routeDefinition) {
- this.root = routeDefinition;
- }
-
- @JsonAnySetter
- public void handleUnknownField(String id, JsonNode node) {
- if (root != null) {
- throw new IllegalArgumentException("A root is already set: " + root.getType());
+ public String getEndpointUri() {
+ String answer = uri;
+
+ if (parameters != null) {
+ try {
+ answer = URISupport.appendParametersToURI(answer, parameters);
+ } catch (URISyntaxException | UnsupportedEncodingException e) {
+ throw new RuntimeException(e);
+ }
}
- setRoot(new Node(id, node));
+
+ return answer;
}
}
-
}
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/RoutingSlipStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/RoutingSlipStepParser.java
index dd55300..3b6ae84 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/RoutingSlipStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/RoutingSlipStepParser.java
@@ -24,7 +24,7 @@ import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.RoutingSlipDefinition;
import org.apache.camel.reifier.RoutingSlipReifier;
-@YAMLStepParser("routing-slip")
+@YAMLStepParser(id = "routing-slip", definitions = RoutingSlipStepParser.Definition.class)
public class RoutingSlipStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SagaStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SagaStepParser.java
index 5f6186b..79d9208 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SagaStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SagaStepParser.java
@@ -18,6 +18,7 @@ package org.apache.camel.k.loader.yaml.parser;
import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
import org.apache.camel.k.loader.yaml.model.Step;
@@ -27,7 +28,7 @@ import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.SagaDefinition;
import org.apache.camel.reifier.SagaReifier;
-@YAMLStepParser("saga")
+@YAMLStepParser(id = "saga", definitions = SagaStepParser.Definition.class)
public class SagaStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
@@ -42,6 +43,7 @@ public class SagaStepParser implements ProcessorStepParser {
@YAMLNodeDefinition(reifiers = SagaReifier.class)
public static final class Definition extends SagaDefinition {
+ @JsonProperty
public List<Step> steps;
}
}
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SampleStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SampleStepParser.java
index 48a55c7..4afae6e 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SampleStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SampleStepParser.java
@@ -18,6 +18,7 @@ package org.apache.camel.k.loader.yaml.parser;
import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
import org.apache.camel.k.loader.yaml.model.Step;
@@ -27,7 +28,7 @@ import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.SamplingDefinition;
import org.apache.camel.reifier.SamplingReifier;
-@YAMLStepParser("sample")
+@YAMLStepParser(id = "sample", definitions = SampleStepParser.Definition.class)
public class SampleStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
@@ -42,6 +43,7 @@ public class SampleStepParser implements ProcessorStepParser {
@YAMLNodeDefinition(reifiers = SamplingReifier.class)
public static final class Definition extends SamplingDefinition {
+ @JsonProperty
public List<Step> steps;
}
}
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ScriptStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ScriptStepParser.java
index 8abe16c..3f5861e 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ScriptStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ScriptStepParser.java
@@ -23,7 +23,7 @@ import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.ScriptDefinition;
import org.apache.camel.reifier.ScriptReifier;
-@YAMLStepParser("script")
+@YAMLStepParser(id = "script", definitions = ScriptStepParser.Definition.class)
public class ScriptStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ServiceCallStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ServiceCallStepParser.java
index 2b9a8d1..baf3559 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ServiceCallStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ServiceCallStepParser.java
@@ -17,6 +17,7 @@
package org.apache.camel.k.loader.yaml.parser;
import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
import org.apache.camel.k.loader.yaml.spi.ProcessorStepParser;
import org.apache.camel.model.ProcessorDefinition;
@@ -27,7 +28,7 @@ import org.apache.camel.model.cloud.ServiceCallServiceFilterConfiguration;
import org.apache.camel.model.cloud.ServiceCallServiceLoadBalancerConfiguration;
import org.apache.camel.model.language.ExpressionDefinition;
-@YAMLStepParser("service-call")
+@YAMLStepParser(id = "service-call", definitions = ServiceCallStepParser.Definition.class)
public class ServiceCallStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
@@ -41,6 +42,7 @@ public class ServiceCallStepParser implements ProcessorStepParser {
// may need to be fixed in camel to use an ExpressionDefinition instead
// of just Expression.
//
+ @YAMLNodeDefinition
public static final class Definition implements HasExpression {
private final ServiceCallDefinition delegate;
@@ -192,6 +194,7 @@ public class ServiceCallStepParser implements ProcessorStepParser {
}
}
+ @YAMLNodeDefinition
public static final class ServiceCallExpressionDefinition extends ServiceCallExpressionConfiguration implements HasExpression {
@JsonIgnore
@Override
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SetBodyStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SetBodyStepParser.java
index f4fddb1..3b09cc5 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SetBodyStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SetBodyStepParser.java
@@ -23,7 +23,7 @@ import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.SetBodyDefinition;
import org.apache.camel.reifier.SetBodyReifier;
-@YAMLStepParser("set-body")
+@YAMLStepParser(id = "set-body", definitions = SetBodyStepParser.Definition.class)
public class SetBodyStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SetExchangePatternStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SetExchangePatternStepParser.java
index 81aa70a..aa6bc6a 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SetExchangePatternStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SetExchangePatternStepParser.java
@@ -16,16 +16,22 @@
*/
package org.apache.camel.k.loader.yaml.parser;
+import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
import org.apache.camel.k.loader.yaml.spi.ProcessorStepParser;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.SetExchangePatternDefinition;
+import org.apache.camel.reifier.SetExchangePatternReifier;
-@YAMLStepParser("set-exchange-pattern")
+@YAMLStepParser(id = "set-exchange-pattern", definitions = SetExchangePatternStepParser.Definition.class)
public class SetExchangePatternStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
- return context.node(SetExchangePatternDefinition.class);
+ return context.node(Definition.class);
+ }
+
+ @YAMLNodeDefinition(reifiers = SetExchangePatternReifier.class)
+ public static class Definition extends SetExchangePatternDefinition {
}
}
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SetHeaderStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SetHeaderStepParser.java
index c6caf62..3db6601 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SetHeaderStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SetHeaderStepParser.java
@@ -23,7 +23,7 @@ import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.SetHeaderDefinition;
import org.apache.camel.reifier.SetHeaderReifier;
-@YAMLStepParser("set-header")
+@YAMLStepParser(id = "set-header", definitions = SetHeaderStepParser.Definition.class)
public class SetHeaderStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SetPropertyStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SetPropertyStepParser.java
index 5d09482..3a7ccdf 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SetPropertyStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SetPropertyStepParser.java
@@ -23,7 +23,7 @@ import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.SetPropertyDefinition;
import org.apache.camel.reifier.SetPropertyReifier;
-@YAMLStepParser("set-property")
+@YAMLStepParser(id = "set-property", definitions = SetPropertyStepParser.Definition.class)
public class SetPropertyStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SortStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SortStepParser.java
index 90f9004..a46f55c 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SortStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SortStepParser.java
@@ -23,7 +23,7 @@ import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.SortDefinition;
import org.apache.camel.reifier.SortReifier;
-@YAMLStepParser("sort")
+@YAMLStepParser(id = "sort", definitions = SortStepParser.Definition.class)
public class SortStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SplitStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SplitStepParser.java
index 3faabca..433e8d2 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SplitStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/SplitStepParser.java
@@ -18,6 +18,7 @@ package org.apache.camel.k.loader.yaml.parser;
import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
import org.apache.camel.k.loader.yaml.model.Step;
@@ -27,7 +28,7 @@ import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.SplitDefinition;
import org.apache.camel.reifier.SplitReifier;
-@YAMLStepParser("split")
+@YAMLStepParser(id = "split", definitions = SplitStepParser.Definition.class)
public class SplitStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
@@ -41,6 +42,7 @@ public class SplitStepParser implements ProcessorStepParser {
@YAMLNodeDefinition(reifiers = SplitReifier.class)
public static final class Definition extends SplitDefinition implements HasExpression {
+ @JsonProperty
public List<Step> steps;
}
}
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/StepStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/StepStepParser.java
index 006133e..e843af2 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/StepStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/StepStepParser.java
@@ -18,6 +18,7 @@ package org.apache.camel.k.loader.yaml.parser;
import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
import org.apache.camel.k.loader.yaml.model.Step;
@@ -26,7 +27,7 @@ import org.apache.camel.k.loader.yaml.spi.StepParserSupport;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.StepDefinition;
-@YAMLStepParser("step")
+@YAMLStepParser(id = "step", definitions = StepStepParser.Definition.class)
public class StepStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
@@ -44,6 +45,7 @@ public class StepStepParser implements ProcessorStepParser {
@YAMLNodeDefinition
public static final class Definition {
+ @JsonProperty
public List<Step> steps;
}
}
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ThrottleStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ThrottleStepParser.java
index 90e8308..24e53a1 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ThrottleStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ThrottleStepParser.java
@@ -23,7 +23,7 @@ import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.ThrottleDefinition;
import org.apache.camel.reifier.ThrottleReifier;
-@YAMLStepParser("throttle")
+@YAMLStepParser(id = "throttle", definitions = ThrottleStepParser.Definition.class)
public class ThrottleStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ThrowExceptionStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ThrowExceptionStepParser.java
index 3933013..96c3303 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ThrowExceptionStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ThrowExceptionStepParser.java
@@ -16,16 +16,22 @@
*/
package org.apache.camel.k.loader.yaml.parser;
+import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
import org.apache.camel.k.loader.yaml.spi.ProcessorStepParser;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.ThrowExceptionDefinition;
+import org.apache.camel.reifier.ThrowExceptionReifier;
-@YAMLStepParser("throw-exception")
+@YAMLStepParser(id = "throw-exception", definitions = ThrowExceptionStepParser.Definition.class)
public class ThrowExceptionStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
- return context.node(ThrowExceptionDefinition.class);
+ return context.node(Definition.class);
+ }
+
+ @YAMLNodeDefinition(reifiers = ThrowExceptionReifier.class)
+ public static class Definition extends ThrowExceptionDefinition {
}
}
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ToDynamicStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ToDynamicStepParser.java
index 19cc5b3..a3dddca 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ToDynamicStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ToDynamicStepParser.java
@@ -21,6 +21,7 @@ import java.net.URISyntaxException;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
import org.apache.camel.k.loader.yaml.spi.ProcessorStepParser;
@@ -28,7 +29,7 @@ import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.ToDynamicDefinition;
import org.apache.camel.util.URISupport;
-@YAMLStepParser({"tod", "to-d"})
+@YAMLStepParser(id = "tod", definitions = ToDynamicStepParser.Definition.class)
public class ToDynamicStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
@@ -40,6 +41,7 @@ public class ToDynamicStepParser implements ProcessorStepParser {
@YAMLNodeDefinition
public static final class Definition extends ToDynamicDefinition {
+ @JsonProperty
public Map<String, Object> parameters;
public Definition() {
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ToStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ToStepParser.java
index 66ba2d3..b46960d 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ToStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ToStepParser.java
@@ -21,6 +21,7 @@ import java.net.URISyntaxException;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
import org.apache.camel.k.loader.yaml.spi.ProcessorStepParser;
@@ -28,7 +29,7 @@ import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.ToDefinition;
import org.apache.camel.util.URISupport;
-@YAMLStepParser("to")
+@YAMLStepParser(id = "to", definitions = ToStepParser.Definition.class)
public class ToStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
@@ -40,6 +41,7 @@ public class ToStepParser implements ProcessorStepParser {
@YAMLNodeDefinition
public static final class Definition extends ToDefinition {
+ @JsonProperty
public Map<String, Object> parameters;
public Definition() {
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/TransactedStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/TransactedStepParser.java
index 1fd34e0..5b338fb 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/TransactedStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/TransactedStepParser.java
@@ -16,16 +16,22 @@
*/
package org.apache.camel.k.loader.yaml.parser;
+import org.apache.camel.k.annotation.yaml.YAMLNodeDefinition;
import org.apache.camel.k.annotation.yaml.YAMLStepParser;
import org.apache.camel.k.loader.yaml.spi.ProcessorStepParser;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.TransactedDefinition;
+import org.apache.camel.reifier.TransactedReifier;
-@YAMLStepParser("transacted")
+@YAMLStepParser(id = "transacted", definitions = TransactedStepParser.Definition.class)
public class TransactedStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
- return context.node(TransactedDefinition.class);
+ return context.node(Definition.class);
+ }
+
+ @YAMLNodeDefinition(reifiers = TransactedReifier.class)
+ public static class Definition extends TransactedDefinition {
}
}
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/TransformStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/TransformStepParser.java
index a12f1a4..b200c75 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/TransformStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/TransformStepParser.java
@@ -23,7 +23,7 @@ import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.TransformDefinition;
import org.apache.camel.reifier.TransformReifier;
-@YAMLStepParser("transform")
+@YAMLStepParser(id = "transform", definitions = TransformStepParser.Definition.class)
public class TransformStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/TypedProcessorStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/TypedProcessorStepParser.java
index cac8d37..1782a06 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/TypedProcessorStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/TypedProcessorStepParser.java
@@ -19,7 +19,6 @@ package org.apache.camel.k.loader.yaml.parser;
import org.apache.camel.k.loader.yaml.spi.ProcessorStepParser;
import org.apache.camel.model.ProcessorDefinition;
-@SuppressWarnings("rawtypes")
public class TypedProcessorStepParser implements ProcessorStepParser {
private final Class<? extends ProcessorDefinition> type;
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/UnmarshalStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/UnmarshalStepParser.java
index aec8e98..613cfb7 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/UnmarshalStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/UnmarshalStepParser.java
@@ -23,7 +23,7 @@ import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.UnmarshalDefinition;
import org.apache.camel.reifier.UnmarshalReifier;
-@YAMLStepParser("unmarshal")
+@YAMLStepParser(id = "unmarshal", definitions = UnmarshalStepParser.Definition.class)
public class UnmarshalStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ValidateStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ValidateStepParser.java
index abd6182..424c9f6 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ValidateStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/ValidateStepParser.java
@@ -23,7 +23,7 @@ import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.ValidateDefinition;
import org.apache.camel.reifier.ValidateReifier;
-@YAMLStepParser("validate")
+@YAMLStepParser(id = "validate", definitions = ValidateStepParser.Definition.class)
public class ValidateStepParser implements ProcessorStepParser {
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/WireTapStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/WireTapStepParser.java
index 9667bfd..2cd5f28 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/WireTapStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/parser/WireTapStepParser.java
@@ -35,9 +35,8 @@ import org.apache.camel.reifier.WireTapReifier;
import org.apache.camel.util.ObjectHelper;
import org.apache.camel.util.URISupport;
-@YAMLStepParser({"wiretap", "wire-tap"})
+@YAMLStepParser(id = "wiretap", definitions = WireTapStepParser.Definition.class)
public class WireTapStepParser implements ProcessorStepParser {
- @SuppressWarnings("unchecked")
@Override
public ProcessorDefinition<?> toProcessor(Context context) {
Definition definition = context.node(Definition.class);
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/support/RemoveHeaderDefinitionMixIn.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/support/RemoveHeaderDefinitionMixIn.java
index 2716f53..9df3d16 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/support/RemoveHeaderDefinitionMixIn.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/support/RemoveHeaderDefinitionMixIn.java
@@ -21,9 +21,9 @@ import org.apache.camel.k.annotation.yaml.YAMLMixIn;
@YAMLMixIn(org.apache.camel.model.RemoveHeaderDefinition.class)
public abstract class RemoveHeaderDefinitionMixIn {
- @JsonAlias({"name", "header-name"})
+ @JsonAlias("name")
public abstract void setHeaderName(String headerName);
- @JsonAlias({"name", "header-name"})
+ @JsonAlias("name")
public abstract String getHeaderName();
}
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/support/RemovePropertyDefinitionMixIn.java b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/support/RemovePropertyDefinitionMixIn.java
index 30b3695..fb20b8f 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/support/RemovePropertyDefinitionMixIn.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/src/main/java/org/apache/camel/k/loader/yaml/support/RemovePropertyDefinitionMixIn.java
@@ -21,9 +21,9 @@ import org.apache.camel.k.annotation.yaml.YAMLMixIn;
@YAMLMixIn(org.apache.camel.model.RemovePropertyDefinition.class)
public abstract class RemovePropertyDefinitionMixIn {
- @JsonAlias({"name", "property-name"})
+ @JsonAlias("name")
public abstract void setPropertyName(String headerName);
- @JsonAlias({"name", "property-name"})
+ @JsonAlias("name")
public abstract String getPropertyName();
}
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml/pom.xml b/camel-k-loader-yaml/camel-k-loader-yaml-support/pom.xml
similarity index 53%
copy from camel-k-loader-yaml/camel-k-loader-yaml/pom.xml
copy to camel-k-loader-yaml/camel-k-loader-yaml-support/pom.xml
index 75023de..8ae8ac6 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml/pom.xml
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-support/pom.xml
@@ -25,7 +25,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>camel-k-loader-yaml</artifactId>
+ <artifactId>camel-k-loader-yaml-support</artifactId>
<dependencies>
@@ -63,56 +63,6 @@
<artifactId>camel-k-annotations</artifactId>
<scope>provided</scope>
</dependency>
-
- <!-- ****************************** -->
- <!-- -->
- <!-- TESTS -->
- <!-- -->
- <!-- ****************************** -->
-
- <dependency>
- <groupId>org.apache.camel.k</groupId>
- <artifactId>camel-k-test</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-mock</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-direct</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-log</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-bean</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.spockframework</groupId>
- <artifactId>spock-core</artifactId>
- <version>${spock.version}</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.codehaus.groovy</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
</dependencies>
<build>
@@ -146,40 +96,26 @@
<goal>generate-yaml-loader-support-classes</goal>
</goals>
<configuration>
- <blacklistedDefinitions>
- <blacklistedDefinition>org.apache.camel.model.Resilience4jConfigurationDefinition</blacklistedDefinition>
- <blacklistedDefinition>org.apache.camel.model.HystrixConfigurationDefinition</blacklistedDefinition>
- <blacklistedDefinition>org.apache.camel.model.FaultToleranceConfigurationDefinition</blacklistedDefinition>
- <blacklistedDefinition>org.apache.camel.model.OnFallbackDefinition</blacklistedDefinition>
- <blacklistedDefinition>org.apache.camel.model.InOnlyDefinition</blacklistedDefinition>
- <blacklistedDefinition>org.apache.camel.model.InOutDefinition</blacklistedDefinition>
- <blacklistedDefinition>org.apache.camel.model.OtherwiseDefinition</blacklistedDefinition>
- <blacklistedDefinition>org.apache.camel.model.WhenDefinition</blacklistedDefinition>
- <blacklistedDefinition>org.apache.camel.model.config.StreamResequencerConfig</blacklistedDefinition>
- <blacklistedDefinition>org.apache.camel.model.config.BatchResequencerConfig</blacklistedDefinition>
- <blacklistedDefinition>org.apache.camel.model.loadbalancer/**</blacklistedDefinition>
- </blacklistedDefinitions>
+ <bannedDefinitions>
+ <bannedDefinition>org.apache.camel.model.Resilience4jConfigurationDefinition</bannedDefinition>
+ <bannedDefinition>org.apache.camel.model.HystrixConfigurationDefinition</bannedDefinition>
+ <bannedDefinition>org.apache.camel.model.FaultToleranceConfigurationDefinition</bannedDefinition>
+ <bannedDefinition>org.apache.camel.model.OnFallbackDefinition</bannedDefinition>
+ <bannedDefinition>org.apache.camel.model.InOnlyDefinition</bannedDefinition>
+ <bannedDefinition>org.apache.camel.model.InOutDefinition</bannedDefinition>
+ <bannedDefinition>org.apache.camel.model.OtherwiseDefinition</bannedDefinition>
+ <bannedDefinition>org.apache.camel.model.WhenDefinition</bannedDefinition>
+ <bannedDefinition>org.apache.camel.model.config.StreamResequencerConfig</bannedDefinition>
+ <bannedDefinition>org.apache.camel.model.config.BatchResequencerConfig</bannedDefinition>
+ <bannedDefinition>org.apache.camel.model.loadbalancer/**</bannedDefinition>
+ <bannedDefinition>org.apache.camel.model.WireTapDefinition</bannedDefinition>
+ <bannedDefinition>org.apache.camel.model.ToDynamicDefinition</bannedDefinition>
+ </bannedDefinitions>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
- <groupId>org.codehaus.gmavenplus</groupId>
- <artifactId>gmavenplus-plugin</artifactId>
- <version>${gmavenplus-plugin.version}</version>
- <executions>
- <execution>
- <goals>
- <goal>addTestSources</goal>
- <goal>compileTests</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <invokeDynamic>true</invokeDynamic>
- </configuration>
- </plugin>
- <plugin>
<groupId>org.jboss.jandex</groupId>
<artifactId>jandex-maven-plugin</artifactId>
<executions>
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml/pom.xml b/camel-k-loader-yaml/camel-k-loader-yaml/pom.xml
index 75023de..21e811e 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml/pom.xml
+++ b/camel-k-loader-yaml/camel-k-loader-yaml/pom.xml
@@ -43,6 +43,10 @@
<groupId>org.apache.camel.k</groupId>
<artifactId>camel-k-loader-yaml-common</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.k</groupId>
+ <artifactId>camel-k-loader-yaml-support</artifactId>
+ </dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
@@ -126,11 +130,17 @@
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
+ <goal>add-resource</goal>
</goals>
<configuration>
<sources>
- <source>${project.build.directory}/generated-sources/camel</source>
+ <source>src/generated/java</source>
</sources>
+ <resources>
+ <resource>
+ <directory>src/generated/resources</directory>
+ </resource>
+ </resources>
</configuration>
</execution>
</executions>
@@ -143,22 +153,25 @@
<execution>
<phase>generate-sources</phase>
<goals>
- <goal>generate-yaml-loader-support-classes</goal>
+ <goal>generate-yaml-schema</goal>
</goals>
<configuration>
- <blacklistedDefinitions>
- <blacklistedDefinition>org.apache.camel.model.Resilience4jConfigurationDefinition</blacklistedDefinition>
- <blacklistedDefinition>org.apache.camel.model.HystrixConfigurationDefinition</blacklistedDefinition>
- <blacklistedDefinition>org.apache.camel.model.FaultToleranceConfigurationDefinition</blacklistedDefinition>
- <blacklistedDefinition>org.apache.camel.model.OnFallbackDefinition</blacklistedDefinition>
- <blacklistedDefinition>org.apache.camel.model.InOnlyDefinition</blacklistedDefinition>
- <blacklistedDefinition>org.apache.camel.model.InOutDefinition</blacklistedDefinition>
- <blacklistedDefinition>org.apache.camel.model.OtherwiseDefinition</blacklistedDefinition>
- <blacklistedDefinition>org.apache.camel.model.WhenDefinition</blacklistedDefinition>
- <blacklistedDefinition>org.apache.camel.model.config.StreamResequencerConfig</blacklistedDefinition>
- <blacklistedDefinition>org.apache.camel.model.config.BatchResequencerConfig</blacklistedDefinition>
- <blacklistedDefinition>org.apache.camel.model.loadbalancer/**</blacklistedDefinition>
- </blacklistedDefinitions>
+ <outputFile>${project.basedir}/src/generated/resources/yaml-schema.json</outputFile>
+ <bannedDefinitions>
+ <bannedDefinition>org.apache.camel.model.Resilience4jConfigurationDefinition</bannedDefinition>
+ <bannedDefinition>org.apache.camel.model.HystrixConfigurationDefinition</bannedDefinition>
+ <bannedDefinition>org.apache.camel.model.FaultToleranceConfigurationDefinition</bannedDefinition>
+ <bannedDefinition>org.apache.camel.model.OnFallbackDefinition</bannedDefinition>
+ <bannedDefinition>org.apache.camel.model.InOnlyDefinition</bannedDefinition>
+ <bannedDefinition>org.apache.camel.model.InOutDefinition</bannedDefinition>
+ <bannedDefinition>org.apache.camel.model.OtherwiseDefinition</bannedDefinition>
+ <bannedDefinition>org.apache.camel.model.WhenDefinition</bannedDefinition>
+ <bannedDefinition>org.apache.camel.model.config.StreamResequencerConfig</bannedDefinition>
+ <bannedDefinition>org.apache.camel.model.config.BatchResequencerConfig</bannedDefinition>
+ <bannedDefinition>org.apache.camel.model.loadbalancer/**</bannedDefinition>
+ <bannedDefinition>org.apache.camel.model.WireTapDefinition</bannedDefinition>
+ <bannedDefinition>org.apache.camel.model.ToDynamicDefinition</bannedDefinition>
+ </bannedDefinitions>
</configuration>
</execution>
</executions>
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml/src/generated/resources/yaml-schema.json b/camel-k-loader-yaml/camel-k-loader-yaml/src/generated/resources/yaml-schema.json
new file mode 100644
index 0000000..0680154
--- /dev/null
+++ b/camel-k-loader-yaml/camel-k-loader-yaml/src/generated/resources/yaml-schema.json
@@ -0,0 +1,3762 @@
+{
+ "$schema" : "http://json-schema.org/draft-04/schema#",
+ "type" : "array",
+ "items" : {
+ "definitions" : {
+ "org.apache.camel.model.language.ConstantExpression" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "expression" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "trim" : {
+ "type" : "string"
+ }
+ },
+ "required" : [ "expression" ]
+ } ]
+ },
+ "expressions" : {
+ "type" : "object",
+ "properties" : {
+ "constant" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.language.ConstantExpression"
+ },
+ "exchange-property" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.language.ExchangePropertyExpression"
+ },
+ "groovy" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.language.GroovyExpression"
+ },
+ "header" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.language.HeaderExpression"
+ },
+ "hl7terser" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.language.Hl7TerserExpression"
+ },
+ "jsonpath" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.language.JsonPathExpression"
+ },
+ "language" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.language.LanguageExpression"
+ },
+ "method" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.language.MethodCallExpression"
+ },
+ "mvel" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.language.MvelExpression"
+ },
+ "ognl" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.language.OgnlExpression"
+ },
+ "ref" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.language.RefExpression"
+ },
+ "simple" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.language.SimpleExpression"
+ },
+ "spel" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.language.SpELExpression"
+ },
+ "tokenize" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.language.TokenizerExpression"
+ },
+ "xpath" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.language.XPathExpression"
+ },
+ "xquery" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.language.XQueryExpression"
+ },
+ "xtokenize" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.language.XMLTokenizerExpression"
+ }
+ }
+ },
+ "org.apache.camel.model.language.ExchangePropertyExpression" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "expression" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "trim" : {
+ "type" : "string"
+ }
+ },
+ "required" : [ "expression" ]
+ } ]
+ },
+ "org.apache.camel.model.language.GroovyExpression" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "expression" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "trim" : {
+ "type" : "string"
+ }
+ },
+ "required" : [ "expression" ]
+ } ]
+ },
+ "org.apache.camel.model.language.HeaderExpression" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "expression" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "trim" : {
+ "type" : "string"
+ }
+ },
+ "required" : [ "expression" ]
+ } ]
+ },
+ "org.apache.camel.model.language.Hl7TerserExpression" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "expression" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "trim" : {
+ "type" : "string"
+ }
+ },
+ "required" : [ "expression" ]
+ } ]
+ },
+ "org.apache.camel.model.language.JsonPathExpression" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "allow-easy-predicate" : {
+ "type" : "string"
+ },
+ "allow-simple" : {
+ "type" : "string"
+ },
+ "header-name" : {
+ "type" : "string"
+ },
+ "result-type" : {
+ "type" : "string"
+ },
+ "suppress-exceptions" : {
+ "type" : "string"
+ },
+ "write-as-string" : {
+ "type" : "string"
+ },
+ "expression" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "trim" : {
+ "type" : "string"
+ }
+ },
+ "required" : [ "expression" ]
+ } ]
+ },
+ "org.apache.camel.model.language.LanguageExpression" : {
+ "type" : "object",
+ "properties" : {
+ "language" : {
+ "type" : "string"
+ },
+ "expression" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "trim" : {
+ "type" : "string"
+ }
+ },
+ "required" : [ "expression" ]
+ },
+ "org.apache.camel.model.language.MethodCallExpression" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "bean-type" : {
+ "type" : "string"
+ },
+ "method" : {
+ "type" : "string"
+ },
+ "ref" : {
+ "type" : "string"
+ },
+ "expression" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "trim" : {
+ "type" : "string"
+ }
+ },
+ "required" : [ "expression" ]
+ } ]
+ },
+ "org.apache.camel.model.language.MvelExpression" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "expression" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "trim" : {
+ "type" : "string"
+ }
+ },
+ "required" : [ "expression" ]
+ } ]
+ },
+ "org.apache.camel.model.language.OgnlExpression" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "expression" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "trim" : {
+ "type" : "string"
+ }
+ },
+ "required" : [ "expression" ]
+ } ]
+ },
+ "org.apache.camel.model.language.RefExpression" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "expression" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "trim" : {
+ "type" : "string"
+ }
+ },
+ "required" : [ "expression" ]
+ } ]
+ },
+ "org.apache.camel.model.language.SimpleExpression" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "result-type" : {
+ "type" : "string"
+ },
+ "expression" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "trim" : {
+ "type" : "string"
+ }
+ },
+ "required" : [ "expression" ]
+ } ]
+ },
+ "org.apache.camel.model.language.SpELExpression" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "expression" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "trim" : {
+ "type" : "string"
+ }
+ },
+ "required" : [ "expression" ]
+ } ]
+ },
+ "org.apache.camel.model.language.TokenizerExpression" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "end-token" : {
+ "type" : "string"
+ },
+ "group" : {
+ "type" : "string"
+ },
+ "group-delimiter" : {
+ "type" : "string"
+ },
+ "header-name" : {
+ "type" : "string"
+ },
+ "include-tokens" : {
+ "type" : "string"
+ },
+ "inherit-namespace-tag-name" : {
+ "type" : "string"
+ },
+ "regex" : {
+ "type" : "string"
+ },
+ "skip-first" : {
+ "type" : "string"
+ },
+ "token" : {
+ "type" : "string"
+ },
+ "xml" : {
+ "type" : "string"
+ },
+ "expression" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "trim" : {
+ "type" : "string"
+ }
+ },
+ "required" : [ "expression" ]
+ } ]
+ },
+ "org.apache.camel.model.language.XPathExpression" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "document-type" : {
+ "type" : "string"
+ },
+ "factory-ref" : {
+ "type" : "string"
+ },
+ "header-name" : {
+ "type" : "string"
+ },
+ "log-namespaces" : {
+ "type" : "string"
+ },
+ "object-model" : {
+ "type" : "string"
+ },
+ "result-type" : {
+ "type" : "string",
+ "enum" : [ "NUMBER", "STRING", "BOOLEAN", "NODESET", "NODE" ]
+ },
+ "saxon" : {
+ "type" : "string"
+ },
+ "thread-safety" : {
+ "type" : "string"
+ },
+ "expression" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "trim" : {
+ "type" : "string"
+ }
+ },
+ "required" : [ "expression" ]
+ } ]
+ },
+ "org.apache.camel.model.language.XQueryExpression" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "header-name" : {
+ "type" : "string"
+ },
+ "type" : {
+ "type" : "string"
+ },
+ "expression" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "trim" : {
+ "type" : "string"
+ }
+ },
+ "required" : [ "expression" ]
+ } ]
+ },
+ "org.apache.camel.model.language.XMLTokenizerExpression" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "group" : {
+ "type" : "string"
+ },
+ "header-name" : {
+ "type" : "string"
+ },
+ "mode" : {
+ "type" : "string"
+ },
+ "expression" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "trim" : {
+ "type" : "string"
+ }
+ },
+ "required" : [ "expression" ]
+ } ]
+ },
+ "org.apache.camel.model.dataformat.Any23DataFormat" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "base-uri" : {
+ "type" : "string"
+ },
+ "output-format" : {
+ "type" : "string",
+ "enum" : [ "NTRIPLES", "TURTLE", "NQUADS", "RDFXML", "JSONLD", "RDFJSON", "RDF4JMODEL" ]
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ } ]
+ },
+ "dataformats" : {
+ "type" : "object",
+ "properties" : {
+ "any23" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.Any23DataFormat"
+ },
+ "asn1" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.ASN1DataFormat"
+ },
+ "avro" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.AvroDataFormat"
+ },
+ "barcode" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.BarcodeDataFormat"
+ },
+ "base64" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.Base64DataFormat"
+ },
+ "beanio" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.BeanioDataFormat"
+ },
+ "bindy" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.BindyDataFormat"
+ },
+ "cbor" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.CBORDataFormat"
+ },
+ "crypto" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.CryptoDataFormat"
+ },
+ "csv" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.CsvDataFormat"
+ },
+ "custom-data-format" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.CustomDataFormat"
+ },
+ "fhir-json" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.FhirJsonDataFormat"
+ },
+ "fhir-xml" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.FhirXmlDataFormat"
+ },
+ "flatpack" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.FlatpackDataFormat"
+ },
+ "grok" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.GrokDataFormat"
+ },
+ "gzipdeflater" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.GzipDataFormat"
+ },
+ "hl7" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.HL7DataFormat"
+ },
+ "ical" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.IcalDataFormat"
+ },
+ "jacksonxml" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.JacksonXMLDataFormat"
+ },
+ "jaxb" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.JaxbDataFormat"
+ },
+ "json" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.JsonDataFormat"
+ },
+ "json-api" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.JsonApiDataFormat"
+ },
+ "lzf" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.LZFDataFormat"
+ },
+ "mime-multipart" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.MimeMultipartDataFormat"
+ },
+ "pgp" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.PGPDataFormat"
+ },
+ "protobuf" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.ProtobufDataFormat"
+ },
+ "rss" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.RssDataFormat"
+ },
+ "secure-xml" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.XMLSecurityDataFormat"
+ },
+ "soapjaxb" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SoapJaxbDataFormat"
+ },
+ "syslog" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SyslogDataFormat"
+ },
+ "tarfile" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.TarFileDataFormat"
+ },
+ "thrift" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.ThriftDataFormat"
+ },
+ "tidy-markup" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.TidyMarkupDataFormat"
+ },
+ "univocity-csv" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.UniVocityCsvDataFormat"
+ },
+ "univocity-fixed" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.UniVocityFixedWidthDataFormat"
+ },
+ "univocity-tsv" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.UniVocityTsvDataFormat"
+ },
+ "xmlrpc" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.XmlRpcDataFormat"
+ },
+ "xstream" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.XStreamDataFormat"
+ },
+ "yaml" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.YAMLDataFormat"
+ },
+ "zipdeflater" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.ZipDeflaterDataFormat"
+ },
+ "zipfile" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.ZipFileDataFormat"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.ASN1DataFormat" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "clazz-name" : {
+ "type" : "string"
+ },
+ "using-iterator" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.model.dataformat.AvroDataFormat" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "instance-class-name" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.model.dataformat.BarcodeDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "barcode-format" : {
+ "type" : "string"
+ },
+ "height" : {
+ "type" : "string"
+ },
+ "image-type" : {
+ "type" : "string"
+ },
+ "width" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.Base64DataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "line-length" : {
+ "type" : "string"
+ },
+ "line-separator" : {
+ "type" : "string"
+ },
+ "url-safe" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.BeanioDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "bean-reader-error-handler-type" : {
+ "type" : "string"
+ },
+ "encoding" : {
+ "type" : "string"
+ },
+ "ignore-invalid-records" : {
+ "type" : "string"
+ },
+ "ignore-unexpected-records" : {
+ "type" : "string"
+ },
+ "ignore-unidentified-records" : {
+ "type" : "string"
+ },
+ "mapping" : {
+ "type" : "string"
+ },
+ "stream-name" : {
+ "type" : "string"
+ },
+ "unmarshal-single-object" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.BindyDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "allow-empty-stream" : {
+ "type" : "string"
+ },
+ "class-type" : {
+ "type" : "string"
+ },
+ "locale" : {
+ "type" : "string"
+ },
+ "type" : {
+ "type" : "string",
+ "enum" : [ "Csv", "Fixed", "KeyValue" ]
+ },
+ "unwrap-single-instance" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ },
+ "required" : [ "type" ]
+ },
+ "org.apache.camel.model.dataformat.CBORDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "allow-jms-type" : {
+ "type" : "string"
+ },
+ "allow-unmarshall-type" : {
+ "type" : "string"
+ },
+ "collection-type-name" : {
+ "type" : "string"
+ },
+ "disable-features" : {
+ "type" : "string"
+ },
+ "enable-features" : {
+ "type" : "string"
+ },
+ "object-mapper" : {
+ "type" : "string"
+ },
+ "pretty-print" : {
+ "type" : "string"
+ },
+ "unmarshal-type-name" : {
+ "type" : "string"
+ },
+ "use-default-object-mapper" : {
+ "type" : "string"
+ },
+ "use-list" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.CryptoDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "algorithm" : {
+ "type" : "string"
+ },
+ "algorithm-parameter-ref" : {
+ "type" : "string"
+ },
+ "buffersize" : {
+ "type" : "string"
+ },
+ "crypto-provider" : {
+ "type" : "string"
+ },
+ "init-vector-ref" : {
+ "type" : "string"
+ },
+ "inline" : {
+ "type" : "string"
+ },
+ "key-ref" : {
+ "type" : "string"
+ },
+ "mac-algorithm" : {
+ "type" : "string"
+ },
+ "should-append-hmac" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.CsvDataFormat" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "allow-missing-column-names" : {
+ "type" : "string"
+ },
+ "comment-marker" : {
+ "type" : "string"
+ },
+ "comment-marker-disabled" : {
+ "type" : "string"
+ },
+ "delimiter" : {
+ "type" : "string"
+ },
+ "escape" : {
+ "type" : "string"
+ },
+ "escape-disabled" : {
+ "type" : "string"
+ },
+ "format-name" : {
+ "type" : "string",
+ "enum" : [ "DEFAULT", "EXCEL", "INFORMIX_UNLOAD", "INFORMIX_UNLOAD_CSV", "MYSQL", "RFC4180" ]
+ },
+ "format-ref" : {
+ "type" : "string"
+ },
+ "header-disabled" : {
+ "type" : "string"
+ },
+ "ignore-empty-lines" : {
+ "type" : "string"
+ },
+ "ignore-header-case" : {
+ "type" : "string"
+ },
+ "ignore-surrounding-spaces" : {
+ "type" : "string"
+ },
+ "lazy-load" : {
+ "type" : "string"
+ },
+ "marshaller-factory-ref" : {
+ "type" : "string"
+ },
+ "null-string" : {
+ "type" : "string"
+ },
+ "null-string-disabled" : {
+ "type" : "string"
+ },
+ "quote" : {
+ "type" : "string"
+ },
+ "quote-disabled" : {
+ "type" : "string"
+ },
+ "quote-mode" : {
+ "type" : "string"
+ },
+ "record-converter-ref" : {
+ "type" : "string"
+ },
+ "record-separator" : {
+ "type" : "string"
+ },
+ "record-separator-disabled" : {
+ "type" : "string"
+ },
+ "skip-header-record" : {
+ "type" : "string"
+ },
+ "trailing-delimiter" : {
+ "type" : "string"
+ },
+ "trim" : {
+ "type" : "string"
+ },
+ "use-maps" : {
+ "type" : "string"
+ },
+ "use-ordered-maps" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.model.dataformat.CustomDataFormat" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "ref" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.model.dataformat.FhirJsonDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "dont-encode-elements" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string"
+ }
+ },
+ "dont-strip-versions-from-references-at-paths" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string"
+ }
+ },
+ "encode-elements" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string"
+ }
+ },
+ "encode-elements-applies-to-child-resources-only" : {
+ "type" : "string"
+ },
+ "fhir-version" : {
+ "type" : "string",
+ "enum" : [ "DSTU2", "DSTU2_HL7ORG", "DSTU2_1", "DSTU3", "R4" ]
+ },
+ "omit-resource-id" : {
+ "type" : "string"
+ },
+ "override-resource-id-with-bundle-entry-full-url" : {
+ "type" : "string"
+ },
+ "pretty-print" : {
+ "type" : "string"
+ },
+ "server-base-url" : {
+ "type" : "string"
+ },
+ "strip-versions-from-references" : {
+ "type" : "string"
+ },
+ "summary-mode" : {
+ "type" : "string"
+ },
+ "suppress-narratives" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.FhirXmlDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "dont-encode-elements" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string"
+ }
+ },
+ "dont-strip-versions-from-references-at-paths" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string"
+ }
+ },
+ "encode-elements" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string"
+ }
+ },
+ "encode-elements-applies-to-child-resources-only" : {
+ "type" : "string"
+ },
+ "fhir-version" : {
+ "type" : "string",
+ "enum" : [ "DSTU2", "DSTU2_HL7ORG", "DSTU2_1", "DSTU3", "R4" ]
+ },
+ "omit-resource-id" : {
+ "type" : "string"
+ },
+ "override-resource-id-with-bundle-entry-full-url" : {
+ "type" : "string"
+ },
+ "pretty-print" : {
+ "type" : "string"
+ },
+ "server-base-url" : {
+ "type" : "string"
+ },
+ "strip-versions-from-references" : {
+ "type" : "string"
+ },
+ "summary-mode" : {
+ "type" : "string"
+ },
+ "suppress-narratives" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.FlatpackDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "allow-short-lines" : {
+ "type" : "string"
+ },
+ "definition" : {
+ "type" : "string"
+ },
+ "delimiter" : {
+ "type" : "string"
+ },
+ "fixed" : {
+ "type" : "string"
+ },
+ "ignore-extra-columns" : {
+ "type" : "string"
+ },
+ "ignore-first-record" : {
+ "type" : "string"
+ },
+ "parser-factory-ref" : {
+ "type" : "string"
+ },
+ "text-qualifier" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.GrokDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "allow-multiple-matches-per-line" : {
+ "type" : "string"
+ },
+ "flattened" : {
+ "type" : "string"
+ },
+ "named-only" : {
+ "type" : "string"
+ },
+ "pattern" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.GzipDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.HL7DataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "validate" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.IcalDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "validating" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.JacksonXMLDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "allow-jms-type" : {
+ "type" : "string"
+ },
+ "allow-unmarshall-type" : {
+ "type" : "string"
+ },
+ "collection-type-name" : {
+ "type" : "string"
+ },
+ "disable-features" : {
+ "type" : "string"
+ },
+ "enable-features" : {
+ "type" : "string"
+ },
+ "enable-jaxb-annotation-module" : {
+ "type" : "string"
+ },
+ "include" : {
+ "type" : "string"
+ },
+ "json-view" : {
+ "type" : "string"
+ },
+ "module-class-names" : {
+ "type" : "string"
+ },
+ "module-refs" : {
+ "type" : "string"
+ },
+ "pretty-print" : {
+ "type" : "string"
+ },
+ "unmarshal-type-name" : {
+ "type" : "string"
+ },
+ "use-list" : {
+ "type" : "string"
+ },
+ "xml-mapper" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.JaxbDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "context-path" : {
+ "type" : "string"
+ },
+ "context-path-is-class-name" : {
+ "type" : "string"
+ },
+ "encoding" : {
+ "type" : "string"
+ },
+ "filter-non-xml-chars" : {
+ "type" : "string"
+ },
+ "fragment" : {
+ "type" : "string"
+ },
+ "ignore-jaxb-element" : {
+ "type" : "string"
+ },
+ "jaxb-provider-properties" : {
+ "type" : "string"
+ },
+ "must-be-jaxb-element" : {
+ "type" : "string"
+ },
+ "namespace-prefix-ref" : {
+ "type" : "string"
+ },
+ "no-namespace-schema-location" : {
+ "type" : "string"
+ },
+ "object-factory" : {
+ "type" : "string"
+ },
+ "part-class" : {
+ "type" : "string"
+ },
+ "part-namespace" : {
+ "type" : "string"
+ },
+ "pretty-print" : {
+ "type" : "string"
+ },
+ "schema" : {
+ "type" : "string"
+ },
+ "schema-location" : {
+ "type" : "string"
+ },
+ "schema-severity-level" : {
+ "type" : "string",
+ "enum" : [ "0", "1", "2" ]
+ },
+ "xml-stream-writer-wrapper" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.JsonDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "allow-jms-type" : {
+ "type" : "string"
+ },
+ "allow-unmarshall-type" : {
+ "type" : "string"
+ },
+ "auto-discover-object-mapper" : {
+ "type" : "string"
+ },
+ "collection-type-name" : {
+ "type" : "string"
+ },
+ "disable-features" : {
+ "type" : "string"
+ },
+ "drop-root-node" : {
+ "type" : "string"
+ },
+ "enable-features" : {
+ "type" : "string"
+ },
+ "include" : {
+ "type" : "string"
+ },
+ "json-view" : {
+ "type" : "string"
+ },
+ "library" : {
+ "enum" : [ "XStream", "Jackson", "Johnzon", "Gson", "Fastjson" ]
+ },
+ "module-class-names" : {
+ "type" : "string"
+ },
+ "module-refs" : {
+ "type" : "string"
+ },
+ "object-mapper" : {
+ "type" : "string"
+ },
+ "permissions" : {
+ "type" : "string"
+ },
+ "pretty-print" : {
+ "type" : "string"
+ },
+ "timezone" : {
+ "type" : "string"
+ },
+ "unmarshal-type-name" : {
+ "type" : "string"
+ },
+ "use-default-object-mapper" : {
+ "type" : "string"
+ },
+ "use-list" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.JsonApiDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "data-format-types" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string"
+ }
+ },
+ "main-format-type" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.LZFDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "using-parallel-compression" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.MimeMultipartDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "binary-content" : {
+ "type" : "string"
+ },
+ "headers-inline" : {
+ "type" : "string"
+ },
+ "include-headers" : {
+ "type" : "string"
+ },
+ "multipart-sub-type" : {
+ "type" : "string"
+ },
+ "multipart-without-attachment" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.PGPDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "algorithm" : {
+ "type" : "string"
+ },
+ "armored" : {
+ "type" : "string"
+ },
+ "compression-algorithm" : {
+ "type" : "string"
+ },
+ "hash-algorithm" : {
+ "type" : "string"
+ },
+ "integrity" : {
+ "type" : "string"
+ },
+ "key-file-name" : {
+ "type" : "string"
+ },
+ "key-userid" : {
+ "type" : "string"
+ },
+ "password" : {
+ "type" : "string"
+ },
+ "provider" : {
+ "type" : "string"
+ },
+ "signature-key-file-name" : {
+ "type" : "string"
+ },
+ "signature-key-ring" : {
+ "type" : "string"
+ },
+ "signature-key-userid" : {
+ "type" : "string"
+ },
+ "signature-password" : {
+ "type" : "string"
+ },
+ "signature-verification-option" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.ProtobufDataFormat" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "content-type-format" : {
+ "type" : "string",
+ "enum" : [ "native", "json" ]
+ },
+ "instance-class" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.model.dataformat.RssDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.XMLSecurityDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "add-key-value-for-encrypted-key" : {
+ "type" : "string"
+ },
+ "digest-algorithm" : {
+ "type" : "string"
+ },
+ "key-cipher-algorithm" : {
+ "type" : "string"
+ },
+ "key-or-trust-store-parameters-ref" : {
+ "type" : "string"
+ },
+ "key-password" : {
+ "type" : "string"
+ },
+ "mgf-algorithm" : {
+ "type" : "string"
+ },
+ "pass-phrase" : {
+ "type" : "string"
+ },
+ "pass-phrase-byte" : {
+ "type" : "string",
+ "format" : "binary"
+ },
+ "recipient-key-alias" : {
+ "type" : "string"
+ },
+ "secure-tag" : {
+ "type" : "string"
+ },
+ "secure-tag-contents" : {
+ "type" : "string"
+ },
+ "xml-cipher-algorithm" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.SoapJaxbDataFormat" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "context-path" : {
+ "type" : "string"
+ },
+ "element-name-strategy-ref" : {
+ "type" : "string"
+ },
+ "encoding" : {
+ "type" : "string"
+ },
+ "namespace-prefix-ref" : {
+ "type" : "string"
+ },
+ "schema" : {
+ "type" : "string"
+ },
+ "version" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.model.dataformat.SyslogDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.TarFileDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "allow-empty-directory" : {
+ "type" : "string"
+ },
+ "preserve-path-elements" : {
+ "type" : "string"
+ },
+ "using-iterator" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.ThriftDataFormat" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "content-type-format" : {
+ "type" : "string",
+ "enum" : [ "binary", "json", "sjson" ]
+ },
+ "instance-class" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.model.dataformat.TidyMarkupDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "data-object-type" : {
+ "type" : "string"
+ },
+ "omit-xml-declaration" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.UniVocityCsvDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "delimiter" : {
+ "type" : "string"
+ },
+ "quote" : {
+ "type" : "string"
+ },
+ "quote-all-fields" : {
+ "type" : "string"
+ },
+ "quote-escape" : {
+ "type" : "string"
+ },
+ "as-map" : {
+ "type" : "string"
+ },
+ "comment" : {
+ "type" : "string"
+ },
+ "empty-value" : {
+ "type" : "string"
+ },
+ "header-extraction-enabled" : {
+ "type" : "string"
+ },
+ "headers-disabled" : {
+ "type" : "string"
+ },
+ "ignore-leading-whitespaces" : {
+ "type" : "string"
+ },
+ "ignore-trailing-whitespaces" : {
+ "type" : "string"
+ },
+ "lazy-load" : {
+ "type" : "string"
+ },
+ "line-separator" : {
+ "type" : "string"
+ },
+ "normalized-line-separator" : {
+ "type" : "string"
+ },
+ "null-value" : {
+ "type" : "string"
+ },
+ "number-of-records-to-read" : {
+ "type" : "string"
+ },
+ "skip-empty-lines" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.UniVocityFixedWidthDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "padding" : {
+ "type" : "string"
+ },
+ "record-ends-on-newline" : {
+ "type" : "string"
+ },
+ "skip-trailing-chars-until-newline" : {
+ "type" : "string"
+ },
+ "as-map" : {
+ "type" : "string"
+ },
+ "comment" : {
+ "type" : "string"
+ },
+ "empty-value" : {
+ "type" : "string"
+ },
+ "header-extraction-enabled" : {
+ "type" : "string"
+ },
+ "headers-disabled" : {
+ "type" : "string"
+ },
+ "ignore-leading-whitespaces" : {
+ "type" : "string"
+ },
+ "ignore-trailing-whitespaces" : {
+ "type" : "string"
+ },
+ "lazy-load" : {
+ "type" : "string"
+ },
+ "line-separator" : {
+ "type" : "string"
+ },
+ "normalized-line-separator" : {
+ "type" : "string"
+ },
+ "null-value" : {
+ "type" : "string"
+ },
+ "number-of-records-to-read" : {
+ "type" : "string"
+ },
+ "skip-empty-lines" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.UniVocityTsvDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "escape-char" : {
+ "type" : "string"
+ },
+ "as-map" : {
+ "type" : "string"
+ },
+ "comment" : {
+ "type" : "string"
+ },
+ "empty-value" : {
+ "type" : "string"
+ },
+ "header-extraction-enabled" : {
+ "type" : "string"
+ },
+ "headers-disabled" : {
+ "type" : "string"
+ },
+ "ignore-leading-whitespaces" : {
+ "type" : "string"
+ },
+ "ignore-trailing-whitespaces" : {
+ "type" : "string"
+ },
+ "lazy-load" : {
+ "type" : "string"
+ },
+ "line-separator" : {
+ "type" : "string"
+ },
+ "normalized-line-separator" : {
+ "type" : "string"
+ },
+ "null-value" : {
+ "type" : "string"
+ },
+ "number-of-records-to-read" : {
+ "type" : "string"
+ },
+ "skip-empty-lines" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.XmlRpcDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "request" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.XStreamDataFormat" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "driver" : {
+ "type" : "string"
+ },
+ "driver-ref" : {
+ "type" : "string"
+ },
+ "encoding" : {
+ "type" : "string"
+ },
+ "mode" : {
+ "type" : "string"
+ },
+ "permissions" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.model.dataformat.YAMLDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "allow-any-type" : {
+ "type" : "string"
+ },
+ "allow-recursive-keys" : {
+ "type" : "string"
+ },
+ "constructor" : {
+ "type" : "string"
+ },
+ "dumper-options" : {
+ "type" : "string"
+ },
+ "library" : {
+ "enum" : [ "SnakeYAML" ]
+ },
+ "max-aliases-for-collections" : {
+ "type" : "string"
+ },
+ "pretty-flow" : {
+ "type" : "string"
+ },
+ "representer" : {
+ "type" : "string"
+ },
+ "resolver" : {
+ "type" : "string"
+ },
+ "unmarshal-type-name" : {
+ "type" : "string"
+ },
+ "use-application-context-class-loader" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.ZipDeflaterDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "compression-level" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.dataformat.ZipFileDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "allow-empty-directory" : {
+ "type" : "string"
+ },
+ "preserve-path-elements" : {
+ "type" : "string"
+ },
+ "using-iterator" : {
+ "type" : "string"
+ },
+ "content-type-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.k.loader.yaml.parser.AggregateStepParser$CorrelationExpression" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, { } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.AggregateStepParser$Definition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "aggregate-controller-ref" : {
+ "type" : "string"
+ },
+ "aggregation-repository-ref" : {
+ "type" : "string"
+ },
+ "close-correlation-key-on-completion" : {
+ "type" : "string"
+ },
+ "complete-all-on-stop" : {
+ "type" : "string"
+ },
+ "completion-from-batch-consumer" : {
+ "type" : "string"
+ },
+ "completion-interval" : {
+ "type" : "string"
+ },
+ "completion-on-new-correlation-group" : {
+ "type" : "string"
+ },
+ "completion-size" : {
+ "type" : "string"
+ },
+ "completion-timeout" : {
+ "type" : "string"
+ },
+ "completion-timeout-checker-interval" : {
+ "type" : "string"
+ },
+ "discard-on-aggregation-failure" : {
+ "type" : "string"
+ },
+ "discard-on-completion-timeout" : {
+ "type" : "string"
+ },
+ "eager-check-completion" : {
+ "type" : "string"
+ },
+ "executor-service-ref" : {
+ "type" : "string"
+ },
+ "force-completion-on-stop" : {
+ "type" : "string"
+ },
+ "ignore-invalid-correlation-keys" : {
+ "type" : "string"
+ },
+ "optimistic-locking" : {
+ "type" : "string"
+ },
+ "parallel-processing" : {
+ "type" : "string"
+ },
+ "strategy-method-allow-null" : {
+ "type" : "string"
+ },
+ "strategy-method-name" : {
+ "type" : "string"
+ },
+ "strategy-ref" : {
+ "type" : "string"
+ },
+ "timeout-checker-executor-service-ref" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ },
+ "correlation-expression" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.AggregateStepParser$CorrelationExpression"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.ChoiceStepParser$Definition" : {
+ "type" : "object",
+ "properties" : {
+ "otherwise" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.ChoiceStepParser$Definition$Otherwise"
+ },
+ "when" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.ChoiceStepParser$Definition$When"
+ }
+ }
+ }
+ },
+ "org.apache.camel.k.loader.yaml.parser.ChoiceStepParser$Definition$Otherwise" : {
+ "type" : "object",
+ "properties" : {
+ "steps" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/items/definitions/step"
+ }
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ },
+ "org.apache.camel.k.loader.yaml.parser.ChoiceStepParser$Definition$When" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "steps" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/items/definitions/step"
+ }
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.CircuitBreakerStepParser$CBDefinition" : {
+ "type" : "object",
+ "properties" : {
+ "steps" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/items/definitions/step"
+ }
+ },
+ "on-fallback" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.CircuitBreakerStepParser$FBDefinition"
+ }
+ }
+ },
+ "org.apache.camel.k.loader.yaml.parser.CircuitBreakerStepParser$FBDefinition" : {
+ "type" : "object",
+ "properties" : {
+ "steps" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/items/definitions/step"
+ }
+ },
+ "fallback-via-network" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ },
+ "org.apache.camel.k.loader.yaml.parser.DelayStepParser$Definition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "async-delayed" : {
+ "type" : "string"
+ },
+ "caller-runs-when-rejected" : {
+ "type" : "string"
+ },
+ "executor-service-ref" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.DoTryStepParser$DoCatchDefinition" : {
+ "type" : "object",
+ "properties" : {
+ "steps" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/items/definitions/step"
+ }
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ },
+ "org.apache.camel.k.loader.yaml.parser.DoTryStepParser$DoFinallyDefinition" : {
+ "type" : "object",
+ "properties" : {
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ },
+ "org.apache.camel.k.loader.yaml.parser.DoTryStepParser$DoTryDefinition" : {
+ "type" : "object",
+ "properties" : {
+ "steps" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/items/definitions/step"
+ }
+ }
+ }
+ },
+ "org.apache.camel.k.loader.yaml.parser.DynamicRouterStepParser$Definition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "cache-size" : {
+ "type" : "string"
+ },
+ "ignore-invalid-endpoints" : {
+ "type" : "string"
+ },
+ "uri-delimiter" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.EnrichStepParser$Definition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "aggregate-on-exception" : {
+ "type" : "string"
+ },
+ "strategy-method-allow-null" : {
+ "type" : "string"
+ },
+ "strategy-method-name" : {
+ "type" : "string"
+ },
+ "strategy-ref" : {
+ "type" : "string"
+ },
+ "cache-size" : {
+ "type" : "string"
+ },
+ "ignore-invalid-endpoint" : {
+ "type" : "string"
+ },
+ "share-unit-of-work" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.ErrorHandlerStepParser$Definition" : {
+ "type" : "object",
+ "properties" : {
+ "dead-letter-channel" : {
+ "$ref" : "#/items/definitions/org.apache.camel.builder.DeadLetterChannelBuilder"
+ },
+ "default" : {
+ "$ref" : "#/items/definitions/org.apache.camel.builder.DefaultErrorHandlerBuilder"
+ },
+ "no-error-handler" : {
+ "$ref" : "#/items/definitions/org.apache.camel.builder.NoErrorHandlerBuilder"
+ },
+ "ref" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.builder.DeadLetterChannelBuilder" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "async-delayed-redelivery" : {
+ "type" : "boolean"
+ },
+ "dead-letter-handle-new-exception" : {
+ "type" : "boolean"
+ },
+ "use-original-body" : {
+ "type" : "boolean"
+ },
+ "use-original-message" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.builder.DefaultErrorHandlerBuilder" : {
+ "type" : "object",
+ "properties" : {
+ "async-delayed-redelivery" : {
+ "type" : "boolean"
+ },
+ "dead-letter-handle-new-exception" : {
+ "type" : "boolean"
+ },
+ "use-original-body" : {
+ "type" : "boolean"
+ },
+ "use-original-message" : {
+ "type" : "boolean"
+ }
+ }
+ },
+ "org.apache.camel.builder.NoErrorHandlerBuilder" : {
+ "type" : "object"
+ },
+ "org.apache.camel.k.loader.yaml.parser.FilterStepParser$Definition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "steps" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/items/definitions/step"
+ }
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.FromStepParser$Definition" : {
+ "type" : "object",
+ "properties" : {
+ "parameters" : {
+ "type" : "object"
+ },
+ "steps" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/items/definitions/step"
+ }
+ },
+ "uri" : {
+ "type" : "string"
+ }
+ },
+ "required" : [ "steps", "uri" ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.IdempotentConsumerParser$Definition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "steps" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/items/definitions/step"
+ }
+ },
+ "completion-eager" : {
+ "type" : "string"
+ },
+ "eager" : {
+ "type" : "string"
+ },
+ "message-id-repository-ref" : {
+ "type" : "string"
+ },
+ "remove-on-failure" : {
+ "type" : "string"
+ },
+ "skip-duplicate" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.LoadBalanceStepParser$Definition" : {
+ "type" : "object",
+ "properties" : {
+ "steps" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/items/definitions/step"
+ }
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ },
+ "custom" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.loadbalancer.CustomLoadBalancerDefinition"
+ },
+ "failover" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.loadbalancer.FailoverLoadBalancerDefinition"
+ },
+ "type" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.LoadBalancerDefinition"
+ },
+ "random" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.loadbalancer.RandomLoadBalancerDefinition"
+ },
+ "round-robin" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.loadbalancer.RoundRobinLoadBalancerDefinition"
+ },
+ "sticky" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.LoadBalanceStepParser$Definition$Sticky"
+ },
+ "topic" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.loadbalancer.TopicLoadBalancerDefinition"
+ },
+ "weighted" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.loadbalancer.WeightedLoadBalancerDefinition"
+ }
+ }
+ },
+ "org.apache.camel.model.loadbalancer.CustomLoadBalancerDefinition" : {
+ "type" : "object",
+ "properties" : {
+ "ref" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.loadbalancer.FailoverLoadBalancerDefinition" : {
+ "type" : "object",
+ "properties" : {
+ "maximum-failover-attempts" : {
+ "type" : "string"
+ },
+ "round-robin" : {
+ "type" : "string"
+ },
+ "sticky" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.LoadBalancerDefinition" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "id" : {
+ "type" : "string"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.model.loadbalancer.RandomLoadBalancerDefinition" : {
+ "type" : "object",
+ "properties" : {
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.loadbalancer.RoundRobinLoadBalancerDefinition" : {
+ "type" : "object",
+ "properties" : {
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.k.loader.yaml.parser.LoadBalanceStepParser$Definition$Sticky" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "id" : {
+ "type" : "string"
+ }
+ }
+ }, {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "id" : {
+ "type" : "string"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.model.loadbalancer.TopicLoadBalancerDefinition" : {
+ "type" : "object",
+ "properties" : {
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.loadbalancer.WeightedLoadBalancerDefinition" : {
+ "type" : "object",
+ "properties" : {
+ "distribution-ratio" : {
+ "type" : "string"
+ },
+ "distribution-ratio-delimiter" : {
+ "type" : "string"
+ },
+ "round-robin" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.k.loader.yaml.parser.LoopStepParser$Definition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "steps" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/items/definitions/step"
+ }
+ },
+ "copy" : {
+ "type" : "string"
+ },
+ "do-while" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.MarshalStepParser$Definition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/dataformats"
+ }, {
+ "properties" : {
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.MulticastStepParser$Definition" : {
+ "type" : "object",
+ "properties" : {
+ "steps" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/items/definitions/step"
+ }
+ },
+ "executor-service-ref" : {
+ "type" : "string"
+ },
+ "on-prepare-ref" : {
+ "type" : "string"
+ },
+ "parallel-aggregate" : {
+ "type" : "string"
+ },
+ "parallel-processing" : {
+ "type" : "string"
+ },
+ "share-unit-of-work" : {
+ "type" : "string"
+ },
+ "stop-on-aggregate-exception" : {
+ "type" : "string"
+ },
+ "stop-on-exception" : {
+ "type" : "string"
+ },
+ "strategy-method-allow-null" : {
+ "type" : "string"
+ },
+ "strategy-method-name" : {
+ "type" : "string"
+ },
+ "strategy-ref" : {
+ "type" : "string"
+ },
+ "streaming" : {
+ "type" : "string"
+ },
+ "timeout" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ },
+ "org.apache.camel.k.loader.yaml.parser.OnExceptionStepParser$Definition" : {
+ "type" : "object",
+ "properties" : {
+ "steps" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/items/definitions/step"
+ }
+ }
+ }
+ },
+ "org.apache.camel.k.loader.yaml.parser.OnExceptionStepParser$Definition$ExpressionElement" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, { } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.OnExceptionStepParser$Definition$MaybeBooleanExpressionElement" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, { } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.OnExceptionStepParser$Definition$When" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "steps" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/items/definitions/step"
+ }
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.PipelineStepParser$Definition" : {
+ "type" : "object",
+ "properties" : {
+ "steps" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/items/definitions/step"
+ }
+ }
+ }
+ },
+ "org.apache.camel.k.loader.yaml.parser.PollEnrichStepParser$Definition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "aggregate-on-exception" : {
+ "type" : "string"
+ },
+ "strategy-method-allow-null" : {
+ "type" : "string"
+ },
+ "strategy-method-name" : {
+ "type" : "string"
+ },
+ "strategy-ref" : {
+ "type" : "string"
+ },
+ "cache-size" : {
+ "type" : "string"
+ },
+ "ignore-invalid-endpoint" : {
+ "type" : "string"
+ },
+ "timeout" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.ProcessStepParser$Definition" : {
+ "type" : "object",
+ "properties" : {
+ "ref" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ },
+ "org.apache.camel.k.loader.yaml.parser.RecipientListStepParser$Definition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "cache-size" : {
+ "type" : "string"
+ },
+ "delimiter" : {
+ "type" : "string"
+ },
+ "executor-service-ref" : {
+ "type" : "string"
+ },
+ "ignore-invalid-endpoints" : {
+ "type" : "string"
+ },
+ "on-prepare-ref" : {
+ "type" : "string"
+ },
+ "parallel-aggregate" : {
+ "type" : "string"
+ },
+ "parallel-processing" : {
+ "type" : "string"
+ },
+ "share-unit-of-work" : {
+ "type" : "string"
+ },
+ "stop-on-aggregate-exception" : {
+ "type" : "string"
+ },
+ "stop-on-exception" : {
+ "type" : "string"
+ },
+ "strategy-method-allow-null" : {
+ "type" : "string"
+ },
+ "strategy-method-name" : {
+ "type" : "string"
+ },
+ "strategy-ref" : {
+ "type" : "string"
+ },
+ "streaming" : {
+ "type" : "string"
+ },
+ "timeout" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.ResequenceStepParser$Definition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "steps" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/items/definitions/step"
+ }
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ },
+ "batch-config" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.config.BatchResequencerConfig"
+ },
+ "stream-config" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.config.StreamResequencerConfig"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.model.config.BatchResequencerConfig" : {
+ "type" : "object",
+ "properties" : {
+ "allow-duplicates" : {
+ "type" : "string"
+ },
+ "batch-size" : {
+ "type" : "string"
+ },
+ "batch-timeout" : {
+ "type" : "string"
+ },
+ "ignore-invalid-exchanges" : {
+ "type" : "string"
+ },
+ "reverse" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.model.config.StreamResequencerConfig" : {
+ "type" : "object",
+ "properties" : {
+ "capacity" : {
+ "type" : "string"
+ },
+ "comparator-ref" : {
+ "type" : "string"
+ },
+ "delivery-attempt-interval" : {
+ "type" : "string"
+ },
+ "ignore-invalid-exchanges" : {
+ "type" : "string"
+ },
+ "reject-old" : {
+ "type" : "string"
+ },
+ "timeout" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.k.loader.yaml.parser.RestStepParser$Definition" : {
+ "type" : "object",
+ "properties" : {
+ "api-docs" : {
+ "type" : "boolean"
+ },
+ "binding-mode" : {
+ "enum" : [ "auto", "off", "json", "xml", "json_xml" ]
+ },
+ "consumes" : {
+ "type" : "string"
+ },
+ "description" : {
+ "type" : "string"
+ },
+ "enable-cors" : {
+ "type" : "boolean"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "out-type" : {
+ "type" : "string"
+ },
+ "produces" : {
+ "type" : "string"
+ },
+ "steps" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/items/definitions/step"
+ }
+ },
+ "type" : {
+ "type" : "string"
+ },
+ "uri" : {
+ "type" : "string"
+ },
+ "verb" : {
+ "type" : "string"
+ }
+ }
+ },
+ "org.apache.camel.k.loader.yaml.parser.RouteStepParser$Definition" : {
+ "type" : "object",
+ "properties" : {
+ "from" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.RouteStepParser$From"
+ },
+ "group" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "steps" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/items/definitions/step"
+ }
+ }
+ },
+ "required" : [ "from", "steps" ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.RouteStepParser$From" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "parameters" : {
+ "type" : "object"
+ },
+ "uri" : {
+ "type" : "string"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.RoutingSlipStepParser$Definition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "cache-size" : {
+ "type" : "string"
+ },
+ "ignore-invalid-endpoints" : {
+ "type" : "string"
+ },
+ "uri-delimiter" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.SagaStepParser$Definition" : {
+ "type" : "object",
+ "properties" : {
+ "steps" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/items/definitions/step"
+ }
+ },
+ "completion-mode" : {
+ "type" : "string",
+ "enum" : [ "AUTO", "MANUAL" ]
+ },
+ "propagation" : {
+ "type" : "string",
+ "enum" : [ "REQUIRED", "REQUIRES_NEW", "MANDATORY", "SUPPORTS", "NOT_SUPPORTED", "NEVER" ]
+ },
+ "saga-service-ref" : {
+ "type" : "string"
+ },
+ "timeout" : {
+ "type" : "string"
+ },
+ "timeout-in-milliseconds" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ },
+ "org.apache.camel.k.loader.yaml.parser.SampleStepParser$Definition" : {
+ "type" : "object",
+ "properties" : {
+ "steps" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/items/definitions/step"
+ }
+ },
+ "message-frequency" : {
+ "type" : "string"
+ },
+ "sample-period" : {
+ "type" : "string"
+ },
+ "units" : {
+ "type" : "string",
+ "enum" : [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ]
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ },
+ "org.apache.camel.k.loader.yaml.parser.ScriptStepParser$Definition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.ServiceCallStepParser$Definition" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, { } ]
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.ServiceCallStepParser$ServiceCallExpressionDefinition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "host-header" : {
+ "type" : "string"
+ },
+ "port-header" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.SetBodyStepParser$Definition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.SetExchangePatternStepParser$Definition" : {
+ "type" : "object",
+ "properties" : {
+ "pattern" : {
+ "type" : "string",
+ "enum" : [ "InOnly", "InOut", "InOptionalOut" ]
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ },
+ "required" : [ "pattern" ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.SetHeaderStepParser$Definition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "name" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.SetPropertyStepParser$Definition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "name" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.SortStepParser$Definition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "comparator-ref" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.SplitStepParser$Definition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "steps" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/items/definitions/step"
+ }
+ },
+ "executor-service-ref" : {
+ "type" : "string"
+ },
+ "on-prepare-ref" : {
+ "type" : "string"
+ },
+ "parallel-aggregate" : {
+ "type" : "string"
+ },
+ "parallel-processing" : {
+ "type" : "string"
+ },
+ "share-unit-of-work" : {
+ "type" : "string"
+ },
+ "stop-on-aggregate-exception" : {
+ "type" : "string"
+ },
+ "stop-on-exception" : {
+ "type" : "string"
+ },
+ "strategy-method-allow-null" : {
+ "type" : "string"
+ },
+ "strategy-method-name" : {
+ "type" : "string"
+ },
+ "strategy-ref" : {
+ "type" : "string"
+ },
+ "streaming" : {
+ "type" : "string"
+ },
+ "timeout" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.StepStepParser$Definition" : {
+ "type" : "object",
+ "properties" : {
+ "steps" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/items/definitions/step"
+ }
+ }
+ }
+ },
+ "org.apache.camel.k.loader.yaml.parser.ThrottleStepParser$Definition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "async-delayed" : {
+ "type" : "string"
+ },
+ "caller-runs-when-rejected" : {
+ "type" : "string"
+ },
+ "executor-service-ref" : {
+ "type" : "string"
+ },
+ "reject-execution" : {
+ "type" : "string"
+ },
+ "time-period-millis" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.ThrowExceptionStepParser$Definition" : {
+ "type" : "object",
+ "properties" : {
+ "exception-type" : {
+ "type" : "string"
+ },
+ "message" : {
+ "type" : "string"
+ },
+ "ref" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ },
+ "org.apache.camel.k.loader.yaml.parser.ToDynamicStepParser$Definition" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "parameters" : {
+ "type" : "object"
+ },
+ "allow-optimised-components" : {
+ "type" : "string"
+ },
+ "auto-start-components" : {
+ "type" : "string"
+ },
+ "cache-size" : {
+ "type" : "string"
+ },
+ "ignore-invalid-endpoint" : {
+ "type" : "string"
+ },
+ "pattern" : {
+ "type" : "string",
+ "enum" : [ "InOnly", "InOut", "InOptionalOut" ]
+ },
+ "uri" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ },
+ "required" : [ "uri" ]
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.ToStepParser$Definition" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "parameters" : {
+ "type" : "object"
+ },
+ "pattern" : {
+ "type" : "string",
+ "enum" : [ "InOnly", "InOut", "InOptionalOut" ]
+ },
+ "uri" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ },
+ "required" : [ "uri" ]
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.TransactedStepParser$Definition" : {
+ "type" : "object",
+ "properties" : {
+ "ref" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ },
+ "org.apache.camel.k.loader.yaml.parser.TransformStepParser$Definition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.UnmarshalStepParser$Definition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/dataformats"
+ }, {
+ "properties" : {
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.ValidateStepParser$Definition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.WireTapStepParser$Definition" : {
+ "type" : "object",
+ "properties" : {
+ "allow-optimised-components" : {
+ "type" : "string"
+ },
+ "auto-start-components" : {
+ "type" : "string"
+ },
+ "cache-size" : {
+ "type" : "string"
+ },
+ "ignore-invalid-endpoint" : {
+ "type" : "string"
+ },
+ "pattern" : {
+ "type" : "string",
+ "enum" : [ "InOnly", "InOut", "InOptionalOut" ]
+ },
+ "uri" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ },
+ "required" : [ "uri" ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.WireTapStepParser$HeaderDefinition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, {
+ "properties" : {
+ "name" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.k.loader.yaml.parser.WireTapStepParser$NewExchangeDefinition" : {
+ "type" : "object",
+ "allOf" : [ {
+ "$ref" : "#/items/definitions/expressions"
+ }, { } ]
+ },
+ "org.apache.camel.builder.ErrorHandlerBuilderRef" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object"
+ } ]
+ },
+ "org.apache.camel.builder.ErrorHandlerBuilderSupport" : {
+ "type" : "object"
+ },
+ "step" : {
+ "type" : "object",
+ "maxProperties" : 1,
+ "properties" : {
+ "aggregate" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.AggregateStepParser$Definition"
+ },
+ "choice" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.ChoiceStepParser$Definition"
+ },
+ "circuit-breaker" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.CircuitBreakerStepParser$CBDefinition"
+ },
+ "delay" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.DelayStepParser$Definition"
+ },
+ "do-try" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.DoTryStepParser$DoTryDefinition"
+ },
+ "dynamic-router" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.DynamicRouterStepParser$Definition"
+ },
+ "enrich" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.EnrichStepParser$Definition"
+ },
+ "error-handler" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.ErrorHandlerStepParser$Definition"
+ },
+ "filter" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.FilterStepParser$Definition"
+ },
+ "idempotent-consumer" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.IdempotentConsumerParser$Definition"
+ },
+ "load-balance" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.LoadBalanceStepParser$Definition"
+ },
+ "loop" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.LoopStepParser$Definition"
+ },
+ "marshal" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.MarshalStepParser$Definition"
+ },
+ "multicast" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.MulticastStepParser$Definition"
+ },
+ "on-exception" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.OnExceptionStepParser$Definition"
+ },
+ "pipeline" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.PipelineStepParser$Definition"
+ },
+ "poll-enrich" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.PollEnrichStepParser$Definition"
+ },
+ "process" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.ProcessStepParser$Definition"
+ },
+ "recipient-list" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.RecipientListStepParser$Definition"
+ },
+ "resequence" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.ResequenceStepParser$Definition"
+ },
+ "routing-slip" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.RoutingSlipStepParser$Definition"
+ },
+ "saga" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.SagaStepParser$Definition"
+ },
+ "sample" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.SampleStepParser$Definition"
+ },
+ "script" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.ScriptStepParser$Definition"
+ },
+ "service-call" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.ServiceCallStepParser$Definition"
+ },
+ "set-body" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.SetBodyStepParser$Definition"
+ },
+ "set-exchange-pattern" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.SetExchangePatternStepParser$Definition"
+ },
+ "set-header" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.SetHeaderStepParser$Definition"
+ },
+ "set-property" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.SetPropertyStepParser$Definition"
+ },
+ "sort" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.SortStepParser$Definition"
+ },
+ "split" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.SplitStepParser$Definition"
+ },
+ "step" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.StepStepParser$Definition"
+ },
+ "throttle" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.ThrottleStepParser$Definition"
+ },
+ "throw-exception" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.ThrowExceptionStepParser$Definition"
+ },
+ "tod" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.ToDynamicStepParser$Definition"
+ },
+ "to" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.ToStepParser$Definition"
+ },
+ "transacted" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.TransactedStepParser$Definition"
+ },
+ "transform" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.TransformStepParser$Definition"
+ },
+ "unmarshal" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.UnmarshalStepParser$Definition"
+ },
+ "validate" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.ValidateStepParser$Definition"
+ },
+ "wiretap" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.WireTapStepParser$Definition"
+ },
+ "rollback" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.RollbackDefinition"
+ },
+ "remove-property" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.RemovePropertyDefinition"
+ },
+ "remove-header" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.RemoveHeaderDefinition"
+ },
+ "claim-check" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.ClaimCheckDefinition"
+ },
+ "convert-body-to" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.ConvertBodyDefinition"
+ },
+ "bean" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.BeanDefinition"
+ },
+ "remove-headers" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.RemoveHeadersDefinition"
+ },
+ "stop" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.StopDefinition"
+ },
+ "remove-properties" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.RemovePropertiesDefinition"
+ },
+ "log" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.LogDefinition"
+ },
+ "threads" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.ThreadsDefinition"
+ }
+ }
+ },
+ "org.apache.camel.model.RollbackDefinition" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "mark-rollback-only" : {
+ "type" : "string"
+ },
+ "mark-rollback-only-last" : {
+ "type" : "string"
+ },
+ "message" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.model.RemovePropertyDefinition" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "property-name" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.model.RemoveHeaderDefinition" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "header-name" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.model.ClaimCheckDefinition" : {
+ "type" : "object",
+ "properties" : {
+ "strategy-method-name" : {
+ "type" : "string"
+ },
+ "strategy-ref" : {
+ "type" : "string"
+ },
+ "filter" : {
+ "type" : "string"
+ },
+ "key" : {
+ "type" : "string"
+ },
+ "operation" : {
+ "type" : "string",
+ "enum" : [ "Get", "GetAndRemove", "Set", "Push", "Pop" ]
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ },
+ "org.apache.camel.model.ConvertBodyDefinition" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "charset" : {
+ "type" : "string"
+ },
+ "type" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.model.BeanDefinition" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "bean-type" : {
+ "type" : "string"
+ },
+ "cache" : {
+ "type" : "string"
+ },
+ "method" : {
+ "type" : "string"
+ },
+ "ref" : {
+ "type" : "string"
+ },
+ "scope" : {
+ "type" : "string",
+ "enum" : [ "Singleton", "Request", "Prototype" ]
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.model.RemoveHeadersDefinition" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "exclude-pattern" : {
+ "type" : "string"
+ },
+ "pattern" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.model.StopDefinition" : {
+ "type" : "object",
+ "properties" : {
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ },
+ "org.apache.camel.model.RemovePropertiesDefinition" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "exclude-pattern" : {
+ "type" : "string"
+ },
+ "pattern" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.model.LogDefinition" : {
+ "anyOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "log-name" : {
+ "type" : "string"
+ },
+ "logger-ref" : {
+ "type" : "string"
+ },
+ "logging-level" : {
+ "type" : "string",
+ "enum" : [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ]
+ },
+ "marker" : {
+ "type" : "string"
+ },
+ "message" : {
+ "type" : "string"
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.model.ThreadsDefinition" : {
+ "type" : "object",
+ "properties" : {
+ "allow-core-thread-time-out" : {
+ "type" : "string"
+ },
+ "caller-runs-when-rejected" : {
+ "type" : "string"
+ },
+ "executor-service-ref" : {
+ "type" : "string"
+ },
+ "keep-alive-time" : {
+ "type" : "string"
+ },
+ "max-pool-size" : {
+ "type" : "string"
+ },
+ "max-queue-size" : {
+ "type" : "string"
+ },
+ "pool-size" : {
+ "type" : "string"
+ },
+ "rejected-policy" : {
+ "type" : "string",
+ "enum" : [ "Abort", "CallerRuns", "DiscardOldest", "Discard" ]
+ },
+ "thread-name" : {
+ "type" : "string"
+ },
+ "time-unit" : {
+ "type" : "string",
+ "enum" : [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ]
+ },
+ "inherit-error-handler" : {
+ "type" : "boolean"
+ }
+ }
+ }
+ },
+ "maxProperties" : 1,
+ "properties" : {
+ "error-handler" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.ErrorHandlerStepParser$Definition"
+ },
+ "from" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.FromStepParser$Definition"
+ },
+ "on-exception" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.OnExceptionStepParser$Definition"
+ },
+ "rest" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.RestStepParser$Definition"
+ },
+ "route" : {
+ "$ref" : "#/items/definitions/org.apache.camel.k.loader.yaml.parser.RouteStepParser$Definition"
+ }
+ }
+ }
+}
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/DefinitionsTest.groovy b/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/DefinitionsTest.groovy
index f34daba..0397437 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/DefinitionsTest.groovy
+++ b/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/DefinitionsTest.groovy
@@ -34,9 +34,34 @@ class DefinitionsTest extends TestSupport {
group: my-route-group
from:
uri: "direct:start"
- steps:
- - to:
- uri: "log:info"
+ steps:
+ - to:
+ uri: "log:info"
+ '''.stripMargin('|')
+
+ def camelContext = new DefaultCamelContext()
+ when:
+ camelContext.addRoutes(new YamlSourceLoader().builder(content))
+ then:
+ camelContext.routeDefinitions[0].id == 'my-route-id'
+ camelContext.routeDefinitions[0].group == 'my-route-group'
+ camelContext.routeDefinitions[0].input.endpointUri == 'direct:start'
+
+ with(camelContext.routeDefinitions[0].outputs[0], ToDefinition) {
+ endpointUri == 'log:info'
+ }
+ }
+
+ def "route with id and compact from definition"() {
+ given:
+ def content = '''
+ - route:
+ id: my-route-id
+ group: my-route-group
+ from: "direct:start"
+ steps:
+ - to:
+ uri: "log:info"
'''.stripMargin('|')
def camelContext = new DefaultCamelContext()
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/RoutesTest.groovy b/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/RoutesTest.groovy
index 1d7cc03..882e03a 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/RoutesTest.groovy
+++ b/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/RoutesTest.groovy
@@ -159,4 +159,15 @@ class RoutesTest extends TestSupport {
cleanup:
context?.stop()
}
+
+ def 'bean'() {
+ setup:
+ def context = startContext()
+ when:
+ def out = context.createProducerTemplate().requestBody('direct:route', 'test');
+ then:
+ out == 'TEST'
+ cleanup:
+ context?.stop()
+ }
}
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/parser/CircuitBreakerTest.groovy b/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/parser/CircuitBreakerTest.groovy
index a4068db..5922f34 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/parser/CircuitBreakerTest.groovy
+++ b/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/parser/CircuitBreakerTest.groovy
@@ -52,21 +52,6 @@ class CircuitBreakerTest extends TestSupport {
}
}
- def "definition with alias"() {
- given:
- def stepContext = stepContext('''
- on-fallback:
- via-network: "true"
- ''')
- when:
- def processor = new CircuitBreakerStepParser().toProcessor(stepContext)
- then:
- with(processor, CircuitBreakerDefinition) {
- onFallback != null
- onFallback.fallbackViaNetwork == "true"
- }
- }
-
def "definition with steps"() {
given:
def stepContext = stepContext('''
diff --git a/tooling/camel-k-annotations/src/main/java/org/apache/camel/k/annotation/yaml/YAMLStepParser.java b/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/support/MyUppercaseProcessor.groovy
similarity index 71%
copy from tooling/camel-k-annotations/src/main/java/org/apache/camel/k/annotation/yaml/YAMLStepParser.java
copy to camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/support/MyUppercaseProcessor.groovy
index f546632..96f3388 100644
--- a/tooling/camel-k-annotations/src/main/java/org/apache/camel/k/annotation/yaml/YAMLStepParser.java
+++ b/camel-k-loader-yaml/camel-k-loader-yaml/src/test/groovy/org/apache/camel/k/loader/yaml/support/MyUppercaseProcessor.groovy
@@ -14,15 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.k.annotation.yaml;
+package org.apache.camel.k.loader.yaml.support
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
+import org.apache.camel.Exchange
+import org.apache.camel.Processor
-@Target(ElementType.TYPE)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface YAMLStepParser {
- String[] value();
+class MyUppercaseProcessor implements Processor {
+ @Override
+ void process(Exchange exchange) throws Exception {
+ exchange.in.body = exchange.in.getBody(String.class).toUpperCase();
+ }
}
diff --git a/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-loader-yaml/src/test/resources/routes.yaml b/camel-k-loader-yaml/camel-k-loader-yaml/src/test/resources/routes/RoutesTest_bean.yaml
similarity index 82%
copy from camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-loader-yaml/src/test/resources/routes.yaml
copy to camel-k-loader-yaml/camel-k-loader-yaml/src/test/resources/routes/RoutesTest_bean.yaml
index 6f0a5c5..296683f 100644
--- a/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-loader-yaml/src/test/resources/routes.yaml
+++ b/camel-k-loader-yaml/camel-k-loader-yaml/src/test/resources/routes/RoutesTest_bean.yaml
@@ -14,10 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-
-- route:
- id: yaml
- from:
- uri: 'direct:yaml'
- steps:
- - to: 'log:yaml'
\ No newline at end of file
+- from:
+ uri: "direct:route"
+ steps:
+ - bean:
+ bean-type: org.apache.camel.k.loader.yaml.support.MyUppercaseProcessor
+ - to: "mock:route"
\ No newline at end of file
diff --git a/camel-k-loader-yaml/pom.xml b/camel-k-loader-yaml/pom.xml
index ad6033a..2574154 100644
--- a/camel-k-loader-yaml/pom.xml
+++ b/camel-k-loader-yaml/pom.xml
@@ -30,6 +30,7 @@
<modules>
<module>camel-k-loader-yaml-common</module>
+ <module>camel-k-loader-yaml-support</module>
<module>camel-k-loader-yaml</module>
</modules>
diff --git a/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-loader-yaml/src/test/resources/routes.yaml b/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-loader-yaml/src/test/resources/routes.yaml
index 6f0a5c5..d3cc678 100644
--- a/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-loader-yaml/src/test/resources/routes.yaml
+++ b/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-loader-yaml/src/test/resources/routes.yaml
@@ -19,5 +19,5 @@
id: yaml
from:
uri: 'direct:yaml'
- steps:
- - to: 'log:yaml'
\ No newline at end of file
+ steps:
+ - to: 'log:yaml'
\ No newline at end of file
diff --git a/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-polyglot/src/test/resources/routes.yaml b/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-polyglot/src/test/resources/routes.yaml
index 709e1e0..45dcb92 100644
--- a/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-polyglot/src/test/resources/routes.yaml
+++ b/camel-k-quarkus/camel-k-quarkus-itests/camel-k-quarkus-itests-polyglot/src/test/resources/routes.yaml
@@ -19,7 +19,7 @@
id: yaml
from:
uri: 'direct:yaml'
- steps:
- - marshal:
- json: {}
- - to: 'log:yaml'
\ No newline at end of file
+ steps:
+ - marshal:
+ json: {}
+ - to: 'log:yaml'
\ No newline at end of file
diff --git a/camel-k-runtime-bom/pom.xml b/camel-k-runtime-bom/pom.xml
index 01fabc9..28581b6 100644
--- a/camel-k-runtime-bom/pom.xml
+++ b/camel-k-runtime-bom/pom.xml
@@ -306,6 +306,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel.k</groupId>
+ <artifactId>camel-k-loader-yaml-support</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.k</groupId>
<artifactId>camel-k-loader-yaml</artifactId>
<version>${project.version}</version>
</dependency>
diff --git a/camel-k-runtime-knative/src/test/java/org/apache/camel/k/knative/yaml/parser/KnativeConverterTest.java b/camel-k-runtime-knative/src/test/java/org/apache/camel/k/knative/yaml/parser/KnativeConverterTest.java
index e6839ec..fe818cd 100644
--- a/camel-k-runtime-knative/src/test/java/org/apache/camel/k/knative/yaml/parser/KnativeConverterTest.java
+++ b/camel-k-runtime-knative/src/test/java/org/apache/camel/k/knative/yaml/parser/KnativeConverterTest.java
@@ -53,16 +53,6 @@ public class KnativeConverterTest {
List<RouteDefinition> routes = runtime.camelContext.getRouteDefinitions();
assertThat(routes).hasSize(1);
- // definition
- assertThat(routes)
- .first()
- .extracting(RouteDefinition::getId)
- .isEqualTo("knative");
- assertThat(routes)
- .first()
- .extracting(RouteDefinition::getGroup)
- .isEqualTo("flows");
-
// input
assertThat(routes)
.first()
diff --git a/camel-k-runtime-knative/src/test/resources/route.yaml b/camel-k-runtime-knative/src/test/resources/route.yaml
index 9ba8124..62c978f 100644
--- a/camel-k-runtime-knative/src/test/resources/route.yaml
+++ b/camel-k-runtime-knative/src/test/resources/route.yaml
@@ -15,15 +15,12 @@
# limitations under the License.
#
-- route:
- id: "knative"
- group: "flows"
- knative:
- type: "endpoint"
- name: "from"
- steps:
- - to:
- uri: "log:info"
- - knative:
- type: "endpoint"
- name: "to"
\ No newline at end of file
+- knative:
+ type: "endpoint"
+ name: "from"
+ steps:
+ - to:
+ uri: "log:info"
+ - knative:
+ type: "endpoint"
+ name: "to"
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 257798d..13c276c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -505,6 +505,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel.k</groupId>
+ <artifactId>camel-k-loader-yaml-support</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.k</groupId>
<artifactId>camel-k-loader-js</artifactId>
<version>${project.version}</version>
</dependency>
diff --git a/tooling/camel-k-annotations/src/main/java/org/apache/camel/k/annotation/yaml/YAMLStepParser.java b/tooling/camel-k-annotations/src/main/java/org/apache/camel/k/annotation/yaml/YAMLStepParser.java
index f546632..7634747 100644
--- a/tooling/camel-k-annotations/src/main/java/org/apache/camel/k/annotation/yaml/YAMLStepParser.java
+++ b/tooling/camel-k-annotations/src/main/java/org/apache/camel/k/annotation/yaml/YAMLStepParser.java
@@ -24,5 +24,6 @@ import java.lang.annotation.Target;
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface YAMLStepParser {
- String[] value();
+ String id();
+ Class<?>[] definitions();
}
diff --git a/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/GenerateYamlLoaderSupportClasses.java b/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/GenerateYamlLoaderSupportClasses.java
index 91d7cc5..947a08c 100644
--- a/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/GenerateYamlLoaderSupportClasses.java
+++ b/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/GenerateYamlLoaderSupportClasses.java
@@ -53,7 +53,9 @@ import org.jboss.jandex.ClassInfo;
requiresProject = false)
public class GenerateYamlLoaderSupportClasses extends GenerateYamlSupport {
@Parameter
- protected List<String> blacklistedDefinitions;
+ protected List<String> bannedDefinitions;
+ @Parameter(defaultValue = "${project.build.directory}/generated-sources/camel")
+ protected String output;
@Override
public void execute() throws MojoFailureException {
@@ -101,13 +103,13 @@ public class GenerateYamlLoaderSupportClasses extends GenerateYamlSupport {
.addParameter(Module.SetupContext.class, "context");
definitions(EXPRESSION_DEFINITION_CLASS).forEach(
- (k, v) -> mb.addStatement("context.registerSubtypes(new com.fasterxml.jackson.databind.jsontype.NamedType($L.class, $S))", v.getName(), k)
+ (k, v) -> mb.addStatement("context.registerSubtypes(new com.fasterxml.jackson.databind.jsontype.NamedType($L.class, $S))", v.name().toString(), k)
);
definitions(DATAFORMAT_DEFINITION_CLASS).forEach(
- (k, v) -> mb.addStatement("context.registerSubtypes(new com.fasterxml.jackson.databind.jsontype.NamedType($L.class, $S))", v.getName(), k)
+ (k, v) -> mb.addStatement("context.registerSubtypes(new com.fasterxml.jackson.databind.jsontype.NamedType($L.class, $S))", v.name().toString(), k)
);
definitions(LOAD_BALANCE_DEFINITION_CLASS).forEach(
- (k, v) -> mb.addStatement("context.registerSubtypes(new com.fasterxml.jackson.databind.jsontype.NamedType($L.class, $S))", v.getName(), k)
+ (k, v) -> mb.addStatement("context.registerSubtypes(new com.fasterxml.jackson.databind.jsontype.NamedType($L.class, $S))", v.name().toString(), k)
);
annotated(YAML_MIXIN_ANNOTATION).forEach(i -> {
@@ -178,33 +180,43 @@ public class GenerateYamlLoaderSupportClasses extends GenerateYamlSupport {
.sorted(Comparator.comparing(i -> i.name().toString()))
.forEach(
i -> {
- AnnotationValue value = i.classAnnotation(YAML_STEP_PARSER_ANNOTATION).value();
- for (String id: value.asStringArray()) {
- if (ids.add(id)) {
- mb.beginControlFlow("case $S:", id);
+ AnnotationValue id = i.classAnnotation(YAML_STEP_PARSER_ANNOTATION).value("id");
+ if (id != null) {
+ if (ids.add(id.asString())) {
+ mb.beginControlFlow("case $S:", id.asString());
mb.addStatement("return new $L()", i.name().toString());
mb.endControlFlow();
}
}
+
+ AnnotationValue aliases = i.classAnnotation(YAML_STEP_PARSER_ANNOTATION).value("aliases");
+ if (aliases != null) {
+ for (String alias : aliases.asStringArray()) {
+ if (ids.add(alias)) {
+ mb.beginControlFlow("case $S:", alias);
+ mb.addStatement("return new $L()", i.name().toString());
+ mb.endControlFlow();
+ }
+ }
+ }
}
);
// auto generated parsers
- annotated(XMLROOTELEMENT_ANNOTATION_CLASS)
+ annotated(XML_ROOT_ELEMENT_ANNOTATION_CLASS)
.forEach(
i -> {
AnnotationInstance meta = i.classAnnotation(METADATA_ANNOTATION);
- AnnotationInstance root = i.classAnnotation(XMLROOTELEMENT_ANNOTATION_CLASS);
+ AnnotationInstance root = i.classAnnotation(XML_ROOT_ELEMENT_ANNOTATION_CLASS);
if (meta != null && root != null) {
AnnotationValue name = root.value("name");
AnnotationValue label = meta.value("label");
if (name != null && label != null) {
-
- if (blacklistedDefinitions != null) {
- for (String blacklistedDefinition: blacklistedDefinitions) {
- if (AntPathMatcher.INSTANCE.match(blacklistedDefinition.replace('.', '/'), i.name().toString('/'))) {
+ if (bannedDefinitions != null) {
+ for (String bannedDefinition: bannedDefinitions) {
+ if (AntPathMatcher.INSTANCE.match(bannedDefinition.replace('.', '/'), i.name().toString('/'))) {
getLog().debug("Skipping definition: " + i.name().toString());
return;
}
diff --git a/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/GenerateYamlParserSupportClasses.java b/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/GenerateYamlParserSupportClasses.java
index ad151a0..5a3570c 100644
--- a/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/GenerateYamlParserSupportClasses.java
+++ b/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/GenerateYamlParserSupportClasses.java
@@ -37,6 +37,7 @@ import org.apache.commons.text.WordUtils;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.ResolutionScope;
@Mojo(
@@ -46,6 +47,9 @@ import org.apache.maven.plugins.annotations.ResolutionScope;
requiresDependencyResolution = ResolutionScope.COMPILE,
threadSafe = true)
public class GenerateYamlParserSupportClasses extends GenerateYamlSupport {
+ @Parameter(defaultValue = "${project.build.directory}/generated-sources/camel")
+ protected String output;
+
@Override
public void execute() throws MojoFailureException {
try {
@@ -99,7 +103,7 @@ public class GenerateYamlParserSupportClasses extends GenerateYamlSupport {
.addAnnotation(
AnnotationSpec.builder(JsonAlias.class).addMember("value", "$S", k).build())
.addModifiers(Modifier.PUBLIC, Modifier.DEFAULT)
- .addParameter(v, "definition")
+ .addParameter(loadClass(v), "definition")
.addCode(
CodeBlock.builder()
.beginControlFlow("if (getExpression() != null)")
@@ -151,7 +155,7 @@ public class GenerateYamlParserSupportClasses extends GenerateYamlSupport {
.addAnnotation(
AnnotationSpec.builder(JsonAlias.class).addMember("value", "$S", k).build())
.addModifiers(Modifier.PUBLIC, Modifier.DEFAULT)
- .addParameter(v, "definition")
+ .addParameter(loadClass(v), "definition")
.addCode(
CodeBlock.builder()
.beginControlFlow("if (getDataFormatType() != null)")
@@ -200,7 +204,7 @@ public class GenerateYamlParserSupportClasses extends GenerateYamlSupport {
.addAnnotation(
AnnotationSpec.builder(JsonAlias.class).addMember("value", "$S", k).build())
.addModifiers(Modifier.PUBLIC, Modifier.DEFAULT)
- .addParameter(v, "definition")
+ .addParameter(loadClass(v), "definition")
.addCode(
CodeBlock.builder()
.beginControlFlow("if (getLoadBalancerType() != null)")
diff --git a/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/GenerateYamlSchema.java b/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/GenerateYamlSchema.java
new file mode 100644
index 0000000..2640992
--- /dev/null
+++ b/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/GenerateYamlSchema.java
@@ -0,0 +1,556 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.k.tooling.maven;
+
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import org.apache.camel.k.tooling.maven.support.IndexerSupport;
+import org.apache.camel.k.tooling.maven.support.MavenSupport;
+import org.apache.camel.util.AntPathMatcher;
+import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.util.StringHelper;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.jboss.jandex.AnnotationInstance;
+import org.jboss.jandex.AnnotationValue;
+import org.jboss.jandex.ClassInfo;
+import org.jboss.jandex.DotName;
+import org.jboss.jandex.FieldInfo;
+import org.jboss.jandex.MethodInfo;
+import org.jboss.jandex.ParameterizedType;
+import org.jboss.jandex.Type;
+
+@Mojo(
+ name = "generate-yaml-schema",
+ inheritByDefault = false,
+ defaultPhase = LifecyclePhase.GENERATE_SOURCES,
+ requiresDependencyResolution = ResolutionScope.COMPILE,
+ threadSafe = true,
+ requiresProject = false)
+public class GenerateYamlSchema extends GenerateYamlSupport {
+ @Parameter
+ protected List<String> bannedDefinitions;
+ @Parameter(property = "camel.k.yaml.schema", defaultValue = "${project.build.directory}/yaml-${project.version}.json")
+ private File outputFile;
+
+ private ObjectNode items;
+ private ObjectNode definitions;
+
+ @Override
+ public void execute() throws MojoFailureException {
+ final ObjectMapper mapper = new ObjectMapper();
+ final ObjectNode root = mapper.createObjectNode();
+
+ // Schema
+ root.put("$schema", "http://json-schema.org/draft-04/schema#");
+ root.put("type", "array");
+
+ // Schema sections
+ this.items = root.putObject("items");
+ this.definitions = this.items.putObject("definitions");
+
+ definitions(EXPRESSION_DEFINITION_CLASS).entrySet().stream()
+ .sorted(Map.Entry.comparingByKey())
+ .forEach(entry -> {
+ processType(
+ definitions.with(entry.getValue().name().toString()),
+ entry.getValue());
+
+ definitions.with("expressions")
+ .put("type", "object")
+ .with("properties")
+ .putObject(StringHelper.camelCaseToDash(entry.getKey()))
+ .put("$ref", "#/items/definitions/" + entry.getValue().name().toString());
+ });
+ definitions(DATAFORMAT_DEFINITION_CLASS).entrySet().stream()
+ .sorted(Map.Entry.comparingByKey())
+ .forEach(entry -> {
+ processType(
+ definitions.with(entry.getValue().name().toString()),
+ entry.getValue());
+
+ definitions.with("dataformats")
+ .put("type", "object")
+ .with("properties")
+ .putObject(StringHelper.camelCaseToDash(entry.getKey()))
+ .put("$ref", "#/items/definitions/" + entry.getValue().name().toString());
+ });
+
+ // custom node definitions
+ annotated(YAML_NODE_DEFINITION_ANNOTATION)
+ .sorted(Comparator.comparing(entry -> entry.name().toString()))
+ .forEach(i -> processType(definitions.with(i.name().toString()), i));
+
+ Set<String> ids = new HashSet<>();
+
+ implementors(ERROR_HANDLER_CLASS)
+ .sorted(Comparator.comparing(entry -> entry.name().toString()))
+ .forEach(
+ entry -> {
+ ObjectNode node = definitions.putObject(entry.name().toString());
+ if (hasStringConstructor(entry)) {
+ ArrayNode anyOf = node.putArray("anyOf");
+ anyOf.addObject()
+ .put("type", "string");
+
+ node = anyOf.addObject();
+ }
+
+ node.put("type", "object");
+
+ for (MethodInfo mi: IndexerSupport.methods(view.get(), entry)) {
+ if (mi.returnType().kind() != Type.Kind.VOID) {
+ continue;
+ }
+ if (mi.parameters().size() != 1) {
+ continue;
+ }
+ if (mi.parameters().get(0).kind() != Type.Kind.PRIMITIVE) {
+ continue;
+ }
+ if (!mi.name().startsWith("set")) {
+ continue;
+ }
+
+ String methodName = StringHelper.after(mi.name(), "set");
+ String propertyName = StringHelper.camelCaseToDash(methodName);
+ ObjectNode property = node.with("properties").with(propertyName);
+
+ setJsonSchemaType(property, mi.parameters().get(0));
+ }
+ }
+ );
+
+ // custom parsers
+ annotated(YAML_STEP_PARSER_ANNOTATION)
+ .sorted(Comparator.comparing(entry -> entry.name().toString()))
+ .forEach(
+ entry -> {
+ String stepId = annotationValue(entry, YAML_STEP_PARSER_ANNOTATION, "id")
+ .map(AnnotationValue::asString)
+ .orElseThrow(() -> new IllegalArgumentException("Missing id field"));
+
+ if (!ids.add(stepId)) {
+ return;
+ }
+
+ String[] models = annotationValue(entry, YAML_STEP_PARSER_ANNOTATION, "definitions")
+ .map(AnnotationValue::asStringArray)
+ .orElseThrow(() -> new IllegalArgumentException("Missing definitions field"));
+
+ for (String model: models) {
+ DotName name = DotName.createSimple(model);
+
+ if (implementsInterface(entry, START_STEP_PARSER_CLASS)) {
+ items.put("maxProperties", 1);
+ items.with("properties")
+ .putObject(stepId)
+ .put("$ref", "#/items/definitions/" + name.toString());
+ }
+
+ if (implementsInterface(entry, PROCESSOR_STEP_PARSER_CLASS)) {
+ ObjectNode stepNode = definitions.with("step");
+ stepNode.put("type", "object");
+ stepNode.put("maxProperties", 1);
+
+ stepNode.with("properties")
+ .putObject(stepId)
+ .put("$ref", "#/items/definitions/" + name.toString());
+ }
+ }
+ }
+ );
+
+ // auto generated parsers
+ annotated(XML_ROOT_ELEMENT_ANNOTATION_CLASS)
+ .forEach(
+ i -> {
+ AnnotationInstance meta = i.classAnnotation(METADATA_ANNOTATION);
+ AnnotationInstance xmlRoot = i.classAnnotation(XML_ROOT_ELEMENT_ANNOTATION_CLASS);
+
+ if (meta != null && xmlRoot != null) {
+ AnnotationValue name = xmlRoot.value("name");
+ AnnotationValue label = meta.value("label");
+
+ if (name != null && label != null) {
+ if (bannedDefinitions != null) {
+ for (String bannedDefinition: bannedDefinitions) {
+ if (AntPathMatcher.INSTANCE.match(bannedDefinition.replace('.', '/'), i.name().toString('/'))) {
+ getLog().debug("Skipping definition: " + i.name().toString());
+ return;
+ }
+ }
+ }
+
+ Set<String> labels = Set.of(label.asString().split(",", -1));
+ if (labels.contains("eip")) {
+ String stepId = StringHelper.camelCaseToDash(name.asString());
+ if (!ids.add(stepId)) {
+ return;
+ }
+
+ processType(definitions.with(i.name().toString()), i);
+
+ ObjectNode stepNode = definitions.with("step");
+ stepNode.put("type", "object");
+ stepNode.put("maxProperties", 1);
+
+ stepNode.with("properties")
+ .putObject(stepId)
+ .put("$ref", "#/items/definitions/" + i.name().toString());
+ }
+ }
+ }
+ }
+ );
+
+ try {
+ if (!outputFile.getParentFile().exists()) {
+ outputFile.getParentFile().mkdirs();
+ }
+
+ mapper.writerWithDefaultPrettyPrinter().writeValue(outputFile, root);
+ } catch (IOException e) {
+ throw new MojoFailureException(e.getMessage());
+ }
+ }
+
+ protected void processType(ObjectNode root, ClassInfo type) {
+ if (hasStringConstructor(type)) {
+ ArrayNode anyOf = root.putArray("anyOf");
+ anyOf.addObject()
+ .put("type", "string");
+
+ root = anyOf.addObject();
+ }
+
+ root.put("type", "object");
+
+ boolean allOf = false;
+ if (implementsInterface(type, HAS_EXPRESSION_CLASS)) {
+ root.withArray("allOf").addObject().put("$ref", "#/items/definitions/expressions");
+ allOf = true;
+ }
+ if (implementsInterface(type, HAS_DATAFORMAT_CLASS)) {
+ root.withArray("allOf").addObject().put("$ref", "#/items/definitions/dataformats");
+ allOf = true;
+ }
+
+ if (allOf) {
+ root = root.withArray("allOf").addObject();
+ }
+
+ processFields(root, type);
+ processMethods(root, type);
+ }
+
+ protected void processFields(ObjectNode root, ClassInfo type) {
+ for (FieldInfo fi : IndexerSupport.fields(view.get(), type)) {
+ if (fi.hasAnnotation(XML_TRANSIENT_CLASS)
+ || fi.hasAnnotation(JSON_IGNORE_CLASS)) {
+ continue;
+ }
+ if (!fi.hasAnnotation(XML_VALUE_ANNOTATION_CLASS)
+ && !fi.hasAnnotation(XML_ATTRIBUTE_ANNOTATION_CLASS)
+ && !fi.hasAnnotation(JSON_PROPERTY_CLASS)) {
+ continue;
+ }
+
+ String fieldName = firstPresent(
+ annotationValue(fi, XML_VALUE_ANNOTATION_CLASS, "name")
+ .map(AnnotationValue::asString)
+ .filter(value -> !"##default".equals(value)),
+ annotationValue(fi, XML_ATTRIBUTE_ANNOTATION_CLASS, "name")
+ .map(AnnotationValue::asString)
+ .filter(value -> !"##default".equals(value)),
+ annotationValue(fi, JSON_PROPERTY_CLASS, "value")
+ .map(AnnotationValue::asString)
+ .filter(value -> !"##default".equals(value))
+ ).orElseGet(fi::name);
+
+ String propertyName = StringHelper.camelCaseToDash(fieldName);
+ ObjectNode property = root.with("properties").with(propertyName);
+
+ setJsonSchemaType(property, fi.type());
+
+ annotationValue(fi, METADATA_ANNOTATION, "defaultValue")
+ .map(AnnotationValue::asString)
+ .filter(ObjectHelper::isEmpty)
+ .ifPresent(val -> property.put("default", val));
+ annotationValue(fi, METADATA_ANNOTATION, "description")
+ .map(AnnotationValue::asString)
+ .filter(ObjectHelper::isEmpty)
+ .ifPresent(val -> property.put("description", val));
+ annotationValue(fi, METADATA_ANNOTATION, "enums")
+ .map(AnnotationValue::asString)
+ .ifPresent(val -> setEnum(property, "enum", val));
+
+ if (isRequired(fi)) {
+ root.withArray("required").add(propertyName);
+ }
+ }
+ }
+
+ protected void processMethods(ObjectNode root, ClassInfo type) {
+ for (MethodInfo mi : IndexerSupport.methods(view.get(), type)) {
+ if (mi.hasAnnotation(JSON_IGNORE_CLASS)) {
+ continue;
+ }
+ if (!mi.hasAnnotation(JSON_PROPERTY_CLASS) && !mi.hasAnnotation(JSON_ALIAS_CLASS)) {
+ continue;
+ }
+ if (mi.parameters().size() != 1) {
+ continue;
+ }
+
+ String methodName = firstPresent(
+ annotationValue(mi, JSON_ALIAS_CLASS, "value")
+ .map(AnnotationValue::asStringArray)
+ .filter(values -> values.length > 0)
+ .map(values -> values[0])
+ .filter(ObjectHelper::isNotEmpty),
+ annotationValue(mi, JSON_PROPERTY_CLASS, "value")
+ .map(AnnotationValue::asString)
+ .filter(ObjectHelper::isNotEmpty)
+ ).orElseGet(mi::name);
+
+ if (methodName.startsWith("set")) {
+ methodName = StringHelper.after(methodName, "set");
+ }
+
+ String propertyName = StringHelper.camelCaseToDash(methodName);
+ ObjectNode property = root.with("properties").with(propertyName);
+
+ Type param = mi.parameters().get(0);
+
+ // register types for classes
+ if (param.kind() == Type.Kind.CLASS) {
+ ClassInfo ci = view.get().getClassByName(param.name());
+ if (ci != null && !definitions.has(ci.name().toString())) {
+ processType(definitions.putObject(ci.name().toString()), ci);
+ }
+ }
+
+ setJsonSchemaType(property, param);
+
+ annotationValue(mi, METADATA_ANNOTATION, "defaultValue")
+ .map(AnnotationValue::asString)
+ .filter(ObjectHelper::isEmpty)
+ .ifPresent(val -> property.put("default", val));
+ annotationValue(mi, METADATA_ANNOTATION, "description")
+ .map(AnnotationValue::asString)
+ .filter(ObjectHelper::isEmpty)
+ .ifPresent(val -> property.put("description", val));
+ annotationValue(mi, METADATA_ANNOTATION, "enums")
+ .map(AnnotationValue::asString)
+ .ifPresent(val -> setEnum(property, "enum", val));
+
+ if (isRequired(mi)) {
+ root.withArray("required").add(propertyName);
+ }
+ }
+ }
+
+ // *******************************************
+ //
+ // Helpers
+ //
+ // *******************************************
+
+ protected boolean isRequired(FieldInfo fi) {
+ return firstPresent(
+ annotationValue(fi, METADATA_ANNOTATION, "required")
+ .map(AnnotationValue::asBoolean),
+ annotationValue(fi, JSON_PROPERTY_CLASS, "required")
+ .map(AnnotationValue::asBoolean),
+ annotationValue(fi, XML_VALUE_ANNOTATION_CLASS, "required")
+ .map(AnnotationValue::asBoolean)
+ ).orElse(false);
+ }
+
+ protected boolean isRequired(MethodInfo mi) {
+ return firstPresent(
+ annotationValue(mi, METADATA_ANNOTATION, "required")
+ .map(AnnotationValue::asBoolean),
+ annotationValue(mi, JSON_PROPERTY_CLASS, "required")
+ .map(AnnotationValue::asBoolean)
+ ).orElse(false);
+ }
+
+ protected static void setEnum(ObjectNode root, String name, String enumValues) {
+ ObjectHelper.notNull(root, "root");
+ ObjectHelper.notNull(name, "name");
+
+ if (ObjectHelper.isEmpty(enumValues)) {
+ return;
+ }
+
+ ArrayNode array = root.putArray(name);
+ for (String enumValue: enumValues.split(",")) {
+ array.add(enumValue);
+ }
+ }
+
+ protected static boolean hasStringConstructor(ClassInfo type) {
+ DotName javaLangString = DotName.createSimple("java.lang.String");
+
+ for (MethodInfo mi: type.methods()) {
+ if (!"<init>".equals(mi.name())) {
+ continue;
+ }
+ if (mi.parameters().size() != 1) {
+ continue;
+ }
+ if (mi.parameters().get(0).name().equals(javaLangString)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ protected static boolean implementsInterface(ClassInfo type, DotName interfaceName) {
+ return type.interfaceNames().stream().anyMatch(i -> i.equals(interfaceName));
+ }
+
+ protected void setJsonSchemaType(ObjectNode node, Type type) {
+ String javaType = type.name().toString();
+ ClassInfo typeClass = view.get().getClassByName(type.name());
+
+ if (type.kind() == Type.Kind.PARAMETERIZED_TYPE) {
+ ParameterizedType parameterized = type.asParameterizedType();
+
+ if (parameterized.arguments().size() == 1) {
+ final Type parametrizedType = parameterized.arguments().get(0);
+ final ClassInfo parametrizedTypeInfo = view.get().getClassByName(parametrizedType.name());
+
+ if (parameterized.name().equals(LIST_CLASS) && parametrizedTypeInfo != null) {
+ if (parametrizedTypeInfo.name().equals(STEP_CLASS)) {
+ node.put("type", "array");
+ node.with("items").put("$ref", "#/items/definitions/step");
+ return;
+ }
+ if (parametrizedTypeInfo.classAnnotation(YAML_NODE_DEFINITION_ANNOTATION) != null) {
+ node.put("type", "array");
+ node.with("items").put("$ref", "#/items/definitions/" + parametrizedTypeInfo.name().toString());
+ return;
+ }
+ }
+ }
+ }
+
+ if (typeClass != null && typeClass.classAnnotation(YAML_NODE_DEFINITION_ANNOTATION) != null) {
+ node.put("$ref", "#/items/definitions/" + type.name().toString());
+ return;
+ }
+
+ switch (javaType) {
+ /*
+ * <tr><th scope="row"> boolean <td style="text-align:center"> Z
+ * <tr><th scope="row"> byte <td style="text-align:center"> B
+ * <tr><th scope="row"> char <td style="text-align:center"> C
+ * <tr><th scope="row"> class or interface <td style="text-align:center"> L<i>classname</i>;
+ * <tr><th scope="row"> double <td style="text-align:center"> D
+ * <tr><th scope="row"> float <td style="text-align:center"> F
+ * <tr><th scope="row"> int <td style="text-align:center"> I
+ * <tr><th scope="row"> long <td style="text-align:center"> J
+ * <tr><th scope="row"> short <td style="text-align:center"> S
+ */
+ case "java.lang.Class":
+ node.put("type", "string");
+ break;
+ case "[B":
+ node.put("type", "string");
+ node.put("format", "binary");
+ break;
+ case "[Ljava.lang.Class;":
+ node.put("type", "array");
+ node.with("items").put("type", "string");
+ break;
+ case "boolean":
+ node.put("type", "boolean");
+ break;
+ case "char":
+ node.put("type", "string");
+ break;
+ case "int":
+ case "float":
+ case "long":
+ case "double":
+ node.put("type", "number");
+ break;
+ default:
+ if (definitions.has(javaType)) {
+ node.put("$ref", "#/items/definitions/" + javaType);
+ } else {
+ try {
+ Class<?> clazz = MavenSupport.getClassLoader(project).loadClass(javaType);
+
+ if (clazz.isEnum()) {
+ ArrayNode array = node.putArray("enum");
+ for (Object t : clazz.getEnumConstants()) {
+ array.add(((Enum) t).name());
+ }
+ } else if (CharSequence.class.isAssignableFrom(clazz)) {
+ node.put("type", "string");
+ } else if (Boolean.class.isAssignableFrom(clazz)) {
+ node.put("type", "boolean");
+ } else if (Number.class.isAssignableFrom(clazz)) {
+ node.put("type", "number");
+ } else if (Collection.class.isAssignableFrom(clazz)) {
+ node.put("type", "array");
+ node.with("items").put("type", "string");
+ } else if (Map.class.isAssignableFrom(clazz)) {
+ node.put("type", "object");
+ } else {
+ throw new IllegalStateException("Unknown java_type: " + javaType + " on node: " + node);
+ }
+ } catch (ClassNotFoundException e) {
+ throw new IllegalStateException("Unknown java_type: " + javaType + " on node: " + node);
+ }
+ }
+ }
+ }
+
+
+ @SafeVarargs
+ protected final <T> Optional<T> firstPresent(Optional<T>... optionals) {
+ for (Optional<T> optional: optionals) {
+ if (optional.isPresent()) {
+ return optional;
+ }
+ }
+
+ return Optional.empty();
+
+ }
+}
diff --git a/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/GenerateYamlSupport.java b/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/GenerateYamlSupport.java
index f402add..aa29185 100644
--- a/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/GenerateYamlSupport.java
+++ b/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/GenerateYamlSupport.java
@@ -17,20 +17,16 @@
package org.apache.camel.k.tooling.maven;
-import java.io.File;
-import java.io.InputStream;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
import java.util.Collections;
-import java.util.Enumeration;
import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
import java.util.Map;
-import java.util.Set;
+import java.util.Optional;
+import java.util.function.Supplier;
import java.util.stream.Stream;
+import org.apache.camel.k.tooling.maven.support.IndexerSupport;
+import org.apache.camel.k.tooling.maven.support.MavenSupport;
+import org.apache.camel.util.function.Suppliers;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
@@ -38,41 +34,79 @@ import org.jboss.jandex.AnnotationInstance;
import org.jboss.jandex.AnnotationTarget;
import org.jboss.jandex.AnnotationValue;
import org.jboss.jandex.ClassInfo;
-import org.jboss.jandex.CompositeIndex;
import org.jboss.jandex.DotName;
-import org.jboss.jandex.IndexReader;
+import org.jboss.jandex.FieldInfo;
import org.jboss.jandex.IndexView;
+import org.jboss.jandex.MethodInfo;
public abstract class GenerateYamlSupport extends AbstractMojo {
- public static final DotName EXPRESSION_DEFINITION_CLASS = DotName.createSimple("org.apache.camel.model.language.ExpressionDefinition");
- public static final DotName DATAFORMAT_DEFINITION_CLASS = DotName.createSimple("org.apache.camel.model.DataFormatDefinition");
- public static final DotName XMLROOTELEMENT_ANNOTATION_CLASS = DotName.createSimple("javax.xml.bind.annotation.XmlRootElement");
- public static final DotName YAML_NODE_DEFINITION_ANNOTATION = DotName.createSimple("org.apache.camel.k.annotation.yaml.YAMLNodeDefinition");
- public static final DotName YAML_STEP_PARSER_ANNOTATION = DotName.createSimple("org.apache.camel.k.annotation.yaml.YAMLStepParser");
- public static final DotName YAML_MIXIN_ANNOTATION = DotName.createSimple("org.apache.camel.k.annotation.yaml.YAMLMixIn");
- public static final DotName LOAD_BALANCE_DEFINITION_CLASS = DotName.createSimple("org.apache.camel.model.LoadBalancerDefinition");
- public static final DotName METADATA_ANNOTATION = DotName.createSimple("org.apache.camel.spi.Metadata");
+
+ public static final DotName LIST_CLASS =
+ DotName.createSimple("java.util.List");
+
+ public static final DotName XML_ROOT_ELEMENT_ANNOTATION_CLASS =
+ DotName.createSimple("javax.xml.bind.annotation.XmlRootElement");
+ public static final DotName XML_ATTRIBUTE_ANNOTATION_CLASS =
+ DotName.createSimple("javax.xml.bind.annotation.XmlAttribute");
+ public static final DotName XML_VALUE_ANNOTATION_CLASS =
+ DotName.createSimple("javax.xml.bind.annotation.XmlValue");
+ public static final DotName XML_TRANSIENT_CLASS =
+ DotName.createSimple("javax.xml.bind.annotation.XmlTransient");
+
+ public static final DotName JSON_PROPERTY_CLASS =
+ DotName.createSimple("com.fasterxml.jackson.annotation.JsonProperty");
+ public static final DotName JSON_IGNORE_CLASS =
+ DotName.createSimple("com.fasterxml.jackson.annotation.JsonIgnore");
+ public static final DotName JSON_ALIAS_CLASS =
+ DotName.createSimple("com.fasterxml.jackson.annotation.JsonAlias");
+
+ public static final DotName METADATA_ANNOTATION =
+ DotName.createSimple("org.apache.camel.spi.Metadata");
+ public static final DotName EXPRESSION_DEFINITION_CLASS =
+ DotName.createSimple("org.apache.camel.model.language.ExpressionDefinition");
+ public static final DotName DATAFORMAT_DEFINITION_CLASS =
+ DotName.createSimple("org.apache.camel.model.DataFormatDefinition");
+ public static final DotName ERROR_HANDLER_CLASS =
+ DotName.createSimple("org.apache.camel.builder.ErrorHandlerBuilder");
+
+ public static final DotName YAML_NODE_DEFINITION_ANNOTATION =
+ DotName.createSimple("org.apache.camel.k.annotation.yaml.YAMLNodeDefinition");
+ public static final DotName YAML_STEP_PARSER_ANNOTATION =
+ DotName.createSimple("org.apache.camel.k.annotation.yaml.YAMLStepParser");
+ public static final DotName YAML_MIXIN_ANNOTATION =
+ DotName.createSimple("org.apache.camel.k.annotation.yaml.YAMLMixIn");
+ public static final DotName LOAD_BALANCE_DEFINITION_CLASS =
+ DotName.createSimple("org.apache.camel.model.LoadBalancerDefinition");
+ public static final DotName START_STEP_PARSER_CLASS =
+ DotName.createSimple("org.apache.camel.k.loader.yaml.spi.StartStepParser");
+ public static final DotName PROCESSOR_STEP_PARSER_CLASS =
+ DotName.createSimple("org.apache.camel.k.loader.yaml.spi.ProcessorStepParser");
+ public static final DotName HAS_EXPRESSION_CLASS =
+ DotName.createSimple("org.apache.camel.k.loader.yaml.parser.HasExpression");
+ public static final DotName HAS_DATAFORMAT_CLASS =
+ DotName.createSimple("org.apache.camel.k.loader.yaml.parser.HasDataFormat");
+ public static final DotName STEP_CLASS =
+ DotName.createSimple("org.apache.camel.k.loader.yaml.model.Step");
+
@Parameter(defaultValue = "${project}", readonly = true, required = true)
protected MavenProject project;
- @Parameter(defaultValue = "${project.build.directory}/generated-sources/camel")
- protected String output;
- protected Map<String, Class<?>> definitions(DotName type) {
- ClassLoader cl = getClassLoader();
- Map<String, Class<?>> definitions = new HashMap<>();
- IndexView view = getCompositeIndexer(cl);
+ protected final Supplier<IndexView> view;
+
+ GenerateYamlSupport() {
+ this.view = Suppliers.memorize(() -> IndexerSupport.get(project));
+ }
+
+ protected Map<String, ClassInfo> definitions(DotName type) {
+ Map<String, ClassInfo> definitions = new HashMap<>();
- for (ClassInfo ci: view.getAllKnownSubclasses(type)) {
- AnnotationInstance instance = ci.classAnnotation(XMLROOTELEMENT_ANNOTATION_CLASS);
+ for (ClassInfo ci: view.get().getAllKnownSubclasses(type)) {
+ AnnotationInstance instance = ci.classAnnotation(XML_ROOT_ELEMENT_ANNOTATION_CLASS);
if (instance != null) {
AnnotationValue name = instance.value("name");
if (name != null) {
- try {
- definitions.put(name.asString(), cl.loadClass(ci.name().toString()));
- } catch (ClassNotFoundException e) {
- throw new RuntimeException(e);
- }
+ definitions.put(name.asString(), ci);
}
}
}
@@ -81,57 +115,54 @@ public abstract class GenerateYamlSupport extends AbstractMojo {
}
protected Stream<ClassInfo> implementors(DotName type) {
- ClassLoader cl = getClassLoader();
- IndexView view = getCompositeIndexer(cl);
-
- return view.getAllKnownImplementors(type).stream();
+ return view.get().getAllKnownImplementors(type).stream();
}
protected Stream<ClassInfo> annotated(DotName type) {
- ClassLoader cl = getClassLoader();
- IndexView view = getCompositeIndexer(cl);
-
- return view.getAnnotations(type).stream()
+ return view.get().getAnnotations(type).stream()
.map(AnnotationInstance::target)
.filter(t -> t.kind() == AnnotationTarget.Kind.CLASS)
.map(AnnotationTarget::asClass);
}
- protected static IndexView getCompositeIndexer(ClassLoader classLoader) {
- try {
- Enumeration<URL> elements = classLoader.getResources("META-INF/jandex.idx");
- List<IndexView> allIndex = new ArrayList<>();
- Set<URL> locations = new HashSet<>();
-
- while (elements.hasMoreElements()) {
- URL url = elements.nextElement();
- if (locations.add(url)) {
- try (InputStream is = url.openStream()) {
- allIndex.add(new IndexReader(is).read());
- }
- }
- }
+ protected Optional<AnnotationValue> annotationValue(AnnotationInstance instance, String name) {
+ return instance != null
+ ? Optional.ofNullable(instance.value(name))
+ : Optional.empty();
+ }
- return CompositeIndex.create(allIndex);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
+ protected Optional<AnnotationValue> annotationValue(ClassInfo target, DotName annotationName, String name) {
+ return annotationValue(
+ target.classAnnotation(annotationName),
+ name
+ );
}
- protected ClassLoader getClassLoader() {
- if (project == null) {
- return getClass().getClassLoader();
- }
+ protected Optional<AnnotationValue> annotationValue(FieldInfo target, DotName annotationName, String name) {
+ return annotationValue(
+ target.annotation(annotationName),
+ name
+ );
+ }
+
+
+ protected Optional<AnnotationValue> annotationValue(MethodInfo target, DotName annotationName, String name) {
+ return annotationValue(
+ target.annotation(annotationName),
+ name
+ );
+ }
+
+ protected Class<?> loadClass(ClassInfo ci) {
+ return loadClass(ci.name().toString());
+ }
+
+ protected Class<?> loadClass(String className) {
try {
- List<String> elements = new ArrayList<>(project.getCompileClasspathElements());
- URL[] urls = new URL[elements.size()];
- for (int i = 0; i < elements.size(); ++i) {
- urls[i] = new File(elements.get(i)).toURI().toURL();
- }
- return new URLClassLoader(urls, this.getClass().getClassLoader());
- } catch (Exception e) {
- return this.getClass().getClassLoader();
+ return MavenSupport.getClassLoader(project).loadClass(className);
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException(e);
}
}
}
diff --git a/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/support/IndexerSupport.java b/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/support/IndexerSupport.java
new file mode 100644
index 0000000..455c63c
--- /dev/null
+++ b/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/support/IndexerSupport.java
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.k.tooling.maven.support;
+
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.function.Predicate;
+
+import org.apache.maven.project.MavenProject;
+import org.jboss.jandex.ClassInfo;
+import org.jboss.jandex.CompositeIndex;
+import org.jboss.jandex.FieldInfo;
+import org.jboss.jandex.IndexReader;
+import org.jboss.jandex.IndexView;
+import org.jboss.jandex.MethodInfo;
+import org.jboss.jandex.Type;
+
+public final class IndexerSupport {
+ private IndexerSupport() {
+ }
+
+ public static IndexView get(MavenProject project) {
+ try {
+ ClassLoader classLoader = MavenSupport.getClassLoader(project);
+ Enumeration<URL> elements = classLoader.getResources("META-INF/jandex.idx");
+ List<IndexView> allIndex = new ArrayList<>();
+ Set<URL> locations = new HashSet<>();
+
+ while (elements.hasMoreElements()) {
+ URL url = elements.nextElement();
+ if (locations.add(url)) {
+ try (InputStream is = url.openStream()) {
+ allIndex.add(new IndexReader(is).read());
+ }
+ }
+ }
+
+ return CompositeIndex.create(allIndex);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static List<FieldInfo> fields(IndexView view, ClassInfo type) {
+ return fields(view, type, fi -> true);
+ }
+
+ public static List<FieldInfo> fields(IndexView view, ClassInfo type, Predicate<FieldInfo> filter) {
+ List<FieldInfo> answer = new ArrayList<>();
+
+ for (ClassInfo current = type; current != null;) {
+ for (FieldInfo fieldInfo: current.fields()) {
+ if (filter.test(fieldInfo)) {
+ answer.add(fieldInfo);
+ }
+ }
+
+ Type superType = current.superClassType();
+ if (superType == null) {
+ break;
+ }
+
+ current = view.getClassByName(superType.name());
+ }
+
+ return answer;
+ }
+
+
+
+ public static List<MethodInfo> methods(IndexView view, ClassInfo type) {
+ return methods(view, type, mi -> true);
+ }
+
+ public static List<MethodInfo> methods(IndexView view, ClassInfo type, Predicate<MethodInfo> filter) {
+ List<MethodInfo> answer = new ArrayList<>();
+
+ for (ClassInfo current = type; current != null;) {
+ for (MethodInfo methodInfo: current.methods()) {
+ if (filter.test(methodInfo)) {
+ answer.add(methodInfo);
+ }
+ }
+
+ Type superType = current.superClassType();
+ if (superType == null) {
+ break;
+ }
+
+ current = view.getClassByName(superType.name());
+ }
+
+ return answer;
+ }
+}
diff --git a/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/support/MavenSupport.java b/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/support/MavenSupport.java
new file mode 100644
index 0000000..0cf167a
--- /dev/null
+++ b/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/support/MavenSupport.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.k.tooling.maven.support;
+
+import java.io.File;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.project.MavenProject;
+
+public final class MavenSupport {
+ private MavenSupport() {
+ }
+
+ public static ClassLoader getClassLoader(MavenProject project) {
+ if (project == null) {
+ return IndexerSupport.class.getClassLoader();
+ }
+
+ try {
+ List<String> elements = new ArrayList<>(project.getCompileClasspathElements());
+ URL[] urls = new URL[elements.size()];
+ for (int i = 0; i < elements.size(); ++i) {
+ urls[i] = new File(elements.get(i)).toURI().toURL();
+ }
+ return new URLClassLoader(urls, IndexerSupport.class.getClassLoader());
+ } catch (Exception e) {
+ return IndexerSupport.class.getClassLoader();
+ }
+ }
+}