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 2026/08/06 05:12:16 UTC
(camel) branch main updated: camel-tui - Rename camelYamlDsl-completion.json to camelYamlDsl-model.json
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 6332f64b4a01 camel-tui - Rename camelYamlDsl-completion.json to camelYamlDsl-model.json
6332f64b4a01 is described below
commit 6332f64b4a017804a250a094ccf9a8309fbe062b
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Aug 6 07:11:47 2026 +0200
camel-tui - Rename camelYamlDsl-completion.json to camelYamlDsl-model.json
camel-yaml-dsl - Document camelYamlDsl-model.json for third-party tooling
Co-Authored-By: Claude Opus 4.6 <no...@anthropic.com>
Signed-off-by: Claus Ibsen <cl...@gmail.com>
---
.../dsl/jbang/core/commands/tui/SourceTab.java | 2 +-
dsl/camel-yaml-dsl/camel-yaml-dsl/pom.xml | 2 +-
...Dsl-completion.json => camelYamlDsl-model.json} | 0
.../camel-yaml-dsl/src/main/docs/yaml-dsl.adoc | 30 ++++++++++++++++++++++
.../camel/dsl/yaml/YamlCompletionTreeTest.java | 2 +-
5 files changed, 33 insertions(+), 3 deletions(-)
diff --git a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SourceTab.java b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SourceTab.java
index 99436a5480b9..346b279eee22 100644
--- a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SourceTab.java
+++ b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SourceTab.java
@@ -1075,7 +1075,7 @@ class SourceTab extends AbstractTab {
private JsonObject getCompletionTree() {
if (!completionTreeLoaded) {
completionTreeLoaded = true;
- try (var is = getClass().getResourceAsStream("/schema/camelYamlDsl-completion.json")) {
+ try (var is = getClass().getResourceAsStream("/schema/camelYamlDsl-model.json")) {
if (is != null) {
String json = new String(is.readAllBytes(), java.nio.charset.StandardCharsets.UTF_8);
completionTree = (JsonObject) org.apache.camel.util.json.Jsoner.deserialize(json);
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/pom.xml b/dsl/camel-yaml-dsl/camel-yaml-dsl/pom.xml
index bf6591c8e2cc..681b9118aa4f 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl/pom.xml
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/pom.xml
@@ -311,7 +311,7 @@
</goals>
<configuration>
<canonicalSchemaFile>src/generated/resources/schema/camelYamlDsl-canonical.json</canonicalSchemaFile>
- <outputFile>src/generated/resources/schema/camelYamlDsl-completion.json</outputFile>
+ <outputFile>src/generated/resources/schema/camelYamlDsl-model.json</outputFile>
</configuration>
</execution>
</executions>
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-completion.json b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-model.json
similarity index 100%
rename from dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-completion.json
rename to dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-model.json
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/docs/yaml-dsl.adoc b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/docs/yaml-dsl.adoc
index 828ea2e286cd..6773f8a975c4 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/docs/yaml-dsl.adoc
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/docs/yaml-dsl.adoc
@@ -257,6 +257,36 @@ This SPI is not a sandbox for processing untrusted YAML documents.
Resolver implementations should not fetch external resources, load classes named by route fields, or evaluate route
fields as expressions while parsing YAML.
+=== YAML DSL Model for Tooling
+
+The `camelYamlDsl-model.json` file is a generated data structure that describes the complete YAML DSL
+structural tree — every valid key at every nesting level, with types, descriptions, required flags,
+default values, enum choices, and references to child nodes. It is generated during the build from
+the canonical YAML DSL JSON schema and enriched with metadata from the Camel catalog (EIP models,
+expression languages, and data formats).
+
+The file is available on the classpath at `schema/camelYamlDsl-model.json` and can be used by
+third-party tooling such as editors, IDE plugins, and visual designers (e.g., Kaoto, Karavan)
+to provide context-aware code completion, validation, and documentation for YAML DSL routes.
+
+The model is organized as a flat map of node definitions under a top-level `nodes` object.
+Key nodes include:
+
+- `root` — the top-level YAML DSL elements (route, from, rest, beans, errorHandler, etc.)
+- `steps` — all valid EIP names that can appear inside a `steps` block
+- `expression` — all available expression language names (simple, jsonpath, xpath, etc.)
+- EIP nodes (e.g., `split`, `filter`, `setHeader`) — each EIP's options including attributes,
+ expression references, and nested steps
+- Language nodes (e.g., `simple`, `jsonpath`) — each language's configuration options
+- Data format nodes (e.g., `csv`, `avro`) — each data format's configuration options
+
+Each child entry in a node carries: `name`, `type`, `description`, `index` (display order),
+`group`, `label`, `required`, `default`, `enum`, `deprecated`, and optionally a `ref`
+pointing to a child node for nested structures.
+
+NOTE: Component endpoint parameters are not included in this file — those are available
+as individual JSON files in the `camel-catalog` module (e.g., `components/kafka.json`).
+
== Defining endpoints
To define an endpoint with the YAML dsl you have two options:
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/java/org/apache/camel/dsl/yaml/YamlCompletionTreeTest.java b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/java/org/apache/camel/dsl/yaml/YamlCompletionTreeTest.java
index db2126be93d2..b025c9efc12a 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/java/org/apache/camel/dsl/yaml/YamlCompletionTreeTest.java
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/java/org/apache/camel/dsl/yaml/YamlCompletionTreeTest.java
@@ -39,7 +39,7 @@ class YamlCompletionTreeTest {
static void loadTree() throws Exception {
ObjectMapper mapper = new ObjectMapper();
try (InputStream is
- = YamlCompletionTreeTest.class.getResourceAsStream("/schema/camelYamlDsl-completion.json")) {
+ = YamlCompletionTreeTest.class.getResourceAsStream("/schema/camelYamlDsl-model.json")) {
assertThat(is).as("completion tree must be on classpath").isNotNull();
tree = mapper.readTree(is);
}