You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2022/10/07 03:34:17 UTC
[camel] branch main updated: CAMEL-18516: camel-yaml-dsl - bannedDefinitions doesn't work for generate-yaml-schema (#8487)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new ca322d562e1 CAMEL-18516: camel-yaml-dsl - bannedDefinitions doesn't work for generate-yaml-schema (#8487)
ca322d562e1 is described below
commit ca322d562e1cb84fd9a7abea82dce525316e7d12
Author: Tomohisa Igarashi <tm...@gmail.com>
AuthorDate: Thu Oct 6 23:34:11 2022 -0400
CAMEL-18516: camel-yaml-dsl - bannedDefinitions doesn't work for generate-yaml-schema (#8487)
---
.../org/apache/camel/maven/dsl/yaml/GenerateYamlSchemaMojo.java | 8 +++++---
dsl/camel-yaml-dsl/camel-yaml-dsl/pom.xml | 6 ------
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin/src/main/java/org/apache/camel/maven/dsl/yaml/GenerateYamlSchemaMojo.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin/src/main/java/org/apache/camel/maven/dsl/yaml/GenerateYamlSchemaMojo.java
index af3ffad2881..9c141d24944 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin/src/main/java/org/apache/camel/maven/dsl/yaml/GenerateYamlSchemaMojo.java
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin/src/main/java/org/apache/camel/maven/dsl/yaml/GenerateYamlSchemaMojo.java
@@ -102,6 +102,11 @@ public class GenerateYamlSchemaMojo extends GenerateYamlSupportMojo {
.map(values -> Stream.of(values).collect(Collectors.toCollection(TreeSet::new)))
.orElseGet(TreeSet::new);
+ final DotName name = DotName.createSimple(entry.getKey());
+ final ClassInfo info = view.getClassByName(name);
+ if (isBanned(info)) {
+ continue;
+ }
if (hasAnnotation(entry.getValue(), YAML_IN_ANNOTATION)) {
nodes.forEach(node -> {
items.with("properties")
@@ -109,9 +114,6 @@ public class GenerateYamlSchemaMojo extends GenerateYamlSupportMojo {
.put("$ref", "#/items/definitions/" + entry.getKey());
});
} else {
- final DotName name = DotName.createSimple(entry.getKey());
- final ClassInfo info = view.getClassByName(name);
-
if (extendsType(info, PROCESSOR_DEFINITION_CLASS)) {
nodes.forEach(node -> {
step.with("properties")
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/pom.xml b/dsl/camel-yaml-dsl/camel-yaml-dsl/pom.xml
index fe57ee8d957..b3743f8b1a4 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl/pom.xml
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/pom.xml
@@ -266,9 +266,6 @@
<configuration>
<kebabCase>false</kebabCase>
<outputFile>src/generated/resources/schema/camelYamlDsl.json</outputFile>
- <bannedDefinitions>
- <bannedDefinition>org.apache.camel.model.FromDefinition</bannedDefinition>
- </bannedDefinitions>
</configuration>
</execution>
<!-- kebab-case -->
@@ -281,9 +278,6 @@
<configuration>
<kebabCase>true</kebabCase>
<outputFile>src/generated/resources/schema/camel-yaml-dsl.json</outputFile>
- <bannedDefinitions>
- <bannedDefinition>org.apache.camel.model.FromDefinition</bannedDefinition>
- </bannedDefinitions>
</configuration>
</execution>
</executions>