This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch xmlio in repository https://gitbox.apache.org/repos/asf/camel.git
commit 50e7a132c9cfa5d9a4fefa0d9cbe332d73055724 Author: Claus Ibsen <[email protected]> AuthorDate: Wed May 14 20:43:13 2025 +0200 CAMEL-22064: camel-xml-io - Generate XSD schema --- .../org/apache/camel/catalog/models/openApi.json | 7 ++++--- .../org/apache/camel/catalog/models/resumable.json | 2 +- .../apache/camel/catalog/schemas/camel-spring.xsd | 24 ++++++++++++++++++---- .../org/apache/camel/model/rest/openApi.json | 7 ++++--- .../META-INF/org/apache/camel/model/resumable.json | 2 +- .../apache/camel/model/ResumableDefinition.java | 16 +++++++++++++++ .../apache/camel/model/app/BeansDefinition.java | 2 ++ .../apache/camel/model/rest/OpenApiDefinition.java | 10 ++++++--- core/camel-xml-io/pom.xml | 4 ---- .../java/org/apache/camel/xml/in/ModelParser.java | 6 ++---- .../java/org/apache/camel/xml/out/ModelWriter.java | 2 +- .../org/apache/camel/yaml/out/ModelWriter.java | 2 +- .../dsl/yaml/deserializers/ModelDeserializers.java | 8 +++++++- .../generated/resources/schema/camelYamlDsl.json | 6 ++++++ 14 files changed, 72 insertions(+), 26 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/openApi.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/openApi.json index ae33c2e1455..b73bc2aa0cc 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/openApi.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/openApi.json @@ -16,8 +16,9 @@ "description": { "index": 1, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the description of this node" }, "disabled": { "index": 2, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable all the REST services from the OpenAPI contract from the route during build time. Once an REST service has been disabled then it cannot be enabled later at runtime." }, "specification": { "index": 3, "kind": "attribute", "displayName": "Specification", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Path to the OpenApi specification file." }, - "routeId": { "index": 4, "kind": "attribute", "displayName": "Route Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the id of the route" }, - "missingOperation": { "index": 5, "kind": "attribute", "displayName": "Missing Operation", "group": "common", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "fail", "ignore", "mock" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "fail", "description": "Whether to fail, ignore or return a mock response for OpenAPI operations that are not mapped to a corresponding route." }, - "mockIncludePattern": { "index": 6, "kind": "attribute", "displayName": "Mock Include Pattern", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "classpath:camel-mock\/**", "description": "Used for inclusive filtering of mock data from directories. The pattern is using Ant-path style pattern. Multiple patterns can be specified separated by comma." } + "apiContextPath": { "index": 4, "kind": "attribute", "displayName": "Api Context Path", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Whether to enable api-doc that exposes the OpenAPI specification file as a REST endpoint. This allows clients to obtain the specification from the running Camel application." }, + "routeId": { "index": 5, "kind": "attribute", "displayName": "Route Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the id of the route" }, + "missingOperation": { "index": 6, "kind": "attribute", "displayName": "Missing Operation", "group": "common", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "fail", "ignore", "mock" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "fail", "description": "Whether to fail, ignore or return a mock response for OpenAPI operations that are not mapped to a corresponding route." }, + "mockIncludePattern": { "index": 7, "kind": "attribute", "displayName": "Mock Include Pattern", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "classpath:camel-mock\/**", "description": "Used for inclusive filtering of mock data from directories. The pattern is using Ant-path style pattern. Multiple patterns can be specified separated by comma." } } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/resumable.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/resumable.json index b63c0b02a58..8ec02d4da05 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/resumable.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/resumable.json @@ -16,7 +16,7 @@ "description": { "index": 1, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the description of this node" }, "disabled": { "index": 2, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." }, "resumeStrategy": { "index": 3, "kind": "attribute", "displayName": "Resume Strategy", "group": "common", "required": true, "type": "object", "javaType": "org.apache.camel.resume.ResumeStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the resume strategy to use" }, - "loggingLevel": { "index": 4, "kind": "attribute", "displayName": "Logging Level", "group": "advanced", "label": "advanced", "required": false, "type": "enum", "javaType": "org.apache.camel.LoggingLevel", "enum": [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "ERROR" }, + "loggingLevel": { "index": 4, "kind": "attribute", "displayName": "Logging Level", "group": "advanced", "label": "advanced", "required": false, "type": "enum", "javaType": "org.apache.camel.LoggingLevel", "enum": [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "ERROR", "description": "The logging level to use in case of failures." }, "intermittent": { "index": 5, "kind": "attribute", "displayName": "Intermittent", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Sets whether the offsets will be intermittently present or whether they must be present in every exchange" } } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd index 841bf26f0b3..dd18084af9d 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd @@ -12512,7 +12512,15 @@ Sets the resume strategy to use. </xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="loggingLevel" type="xs:string"/> + <xs:attribute name="loggingLevel" type="xs:string"> + <xs:annotation> + <xs:documentation xml:lang="en"> +<![CDATA[ +The logging level to use in case of failures. Default value: ERROR +]]> + </xs:documentation> + </xs:annotation> + </xs:attribute> <xs:attribute name="intermittent" type="xs:string"> <xs:annotation> <xs:documentation xml:lang="en"> @@ -15392,14 +15400,22 @@ To configure a special tag for the operations within this rest definition. <xs:complexType name="openApiDefinition"> <xs:complexContent> <xs:extension base="tns:optionalIdentifiedDefinition"> - <xs:sequence> - <xs:element minOccurs="0" name="apiContextPath" type="xs:string"/> - </xs:sequence> + <xs:sequence/> <xs:attribute name="specification" type="xs:string" use="required"> <xs:annotation> <xs:documentation xml:lang="en"> <![CDATA[ Path to the OpenApi specification file. +]]> + </xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="apiContextPath" type="xs:string"> + <xs:annotation> + <xs:documentation xml:lang="en"> +<![CDATA[ +Whether to enable api-doc that exposes the OpenAPI specification file as a REST endpoint. This allows clients to obtain +the specification from the running Camel application. ]]> </xs:documentation> </xs:annotation> diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/rest/openApi.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/rest/openApi.json index ae33c2e1455..b73bc2aa0cc 100644 --- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/rest/openApi.json +++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/rest/openApi.json @@ -16,8 +16,9 @@ "description": { "index": 1, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the description of this node" }, "disabled": { "index": 2, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable all the REST services from the OpenAPI contract from the route during build time. Once an REST service has been disabled then it cannot be enabled later at runtime." }, "specification": { "index": 3, "kind": "attribute", "displayName": "Specification", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Path to the OpenApi specification file." }, - "routeId": { "index": 4, "kind": "attribute", "displayName": "Route Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the id of the route" }, - "missingOperation": { "index": 5, "kind": "attribute", "displayName": "Missing Operation", "group": "common", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "fail", "ignore", "mock" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "fail", "description": "Whether to fail, ignore or return a mock response for OpenAPI operations that are not mapped to a corresponding route." }, - "mockIncludePattern": { "index": 6, "kind": "attribute", "displayName": "Mock Include Pattern", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "classpath:camel-mock\/**", "description": "Used for inclusive filtering of mock data from directories. The pattern is using Ant-path style pattern. Multiple patterns can be specified separated by comma." } + "apiContextPath": { "index": 4, "kind": "attribute", "displayName": "Api Context Path", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Whether to enable api-doc that exposes the OpenAPI specification file as a REST endpoint. This allows clients to obtain the specification from the running Camel application." }, + "routeId": { "index": 5, "kind": "attribute", "displayName": "Route Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the id of the route" }, + "missingOperation": { "index": 6, "kind": "attribute", "displayName": "Missing Operation", "group": "common", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "fail", "ignore", "mock" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "fail", "description": "Whether to fail, ignore or return a mock response for OpenAPI operations that are not mapped to a corresponding route." }, + "mockIncludePattern": { "index": 7, "kind": "attribute", "displayName": "Mock Include Pattern", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "classpath:camel-mock\/**", "description": "Used for inclusive filtering of mock data from directories. The pattern is using Ant-path style pattern. Multiple patterns can be specified separated by comma." } } } diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/resumable.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/resumable.json index b63c0b02a58..8ec02d4da05 100644 --- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/resumable.json +++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/resumable.json @@ -16,7 +16,7 @@ "description": { "index": 1, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the description of this node" }, "disabled": { "index": 2, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." }, "resumeStrategy": { "index": 3, "kind": "attribute", "displayName": "Resume Strategy", "group": "common", "required": true, "type": "object", "javaType": "org.apache.camel.resume.ResumeStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the resume strategy to use" }, - "loggingLevel": { "index": 4, "kind": "attribute", "displayName": "Logging Level", "group": "advanced", "label": "advanced", "required": false, "type": "enum", "javaType": "org.apache.camel.LoggingLevel", "enum": [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "ERROR" }, + "loggingLevel": { "index": 4, "kind": "attribute", "displayName": "Logging Level", "group": "advanced", "label": "advanced", "required": false, "type": "enum", "javaType": "org.apache.camel.LoggingLevel", "enum": [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "ERROR", "description": "The logging level to use in case of failures." }, "intermittent": { "index": 5, "kind": "attribute", "displayName": "Intermittent", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Sets whether the offsets will be intermittently present or whether they must be present in every exchange" } } } diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/ResumableDefinition.java b/core/camel-core-model/src/main/java/org/apache/camel/model/ResumableDefinition.java index cb2ae408310..3b6d9764577 100644 --- a/core/camel-core-model/src/main/java/org/apache/camel/model/ResumableDefinition.java +++ b/core/camel-core-model/src/main/java/org/apache/camel/model/ResumableDefinition.java @@ -22,6 +22,7 @@ import jakarta.xml.bind.annotation.XmlAttribute; import jakarta.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlTransient; +import org.apache.camel.LoggingLevel; import org.apache.camel.resume.ResumeStrategy; import org.apache.camel.resume.ResumeStrategyConfiguration; import org.apache.camel.resume.ResumeStrategyConfigurationBuilder; @@ -169,7 +170,22 @@ public class ResumableDefinition extends NoOutputDefinition<ResumableDefinition> */ public ResumableDefinition intermittent(boolean intermittent) { setIntermittent(Boolean.toString(intermittent)); + return this; + } + /** + * The logging level to use in case of failures. + */ + public ResumableDefinition loggingLevel(String loggingLevel) { + setLoggingLevel(loggingLevel); + return this; + } + + /** + * The logging level to use in case of failures. + */ + public ResumableDefinition loggingLevel(LoggingLevel loggingLevel) { + setLoggingLevel(loggingLevel.name()); return this; } } diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/app/BeansDefinition.java b/core/camel-core-model/src/main/java/org/apache/camel/model/app/BeansDefinition.java index dd9ab235368..bcc2c673197 100644 --- a/core/camel-core-model/src/main/java/org/apache/camel/model/app/BeansDefinition.java +++ b/core/camel-core-model/src/main/java/org/apache/camel/model/app/BeansDefinition.java @@ -29,6 +29,7 @@ import jakarta.xml.bind.annotation.XmlType; import org.w3c.dom.Element; +import jdk.jfr.Description; import org.apache.camel.model.BeanFactoryDefinition; import org.apache.camel.model.DataFormatDefinition; import org.apache.camel.model.RouteConfigurationDefinition; @@ -95,6 +96,7 @@ public class BeansDefinition { @XmlElementWrapper(name = "dataFormats") @XmlElement(name = "dataFormat") @DslProperty(name = "dataFormats") // yaml-dsl + @Description("Camel data formats") private List<DataFormatDefinition> dataFormats; @XmlElement(name = "restConfiguration") private List<RestConfigurationDefinition> restConfigurations = new ArrayList<>(); diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/rest/OpenApiDefinition.java b/core/camel-core-model/src/main/java/org/apache/camel/model/rest/OpenApiDefinition.java index 242026c18d5..1156597cc2b 100644 --- a/core/camel-core-model/src/main/java/org/apache/camel/model/rest/OpenApiDefinition.java +++ b/core/camel-core-model/src/main/java/org/apache/camel/model/rest/OpenApiDefinition.java @@ -38,7 +38,7 @@ public class OpenApiDefinition extends OptionalIdentifiedDefinition<OpenApiDefin @XmlAttribute(required = true) private String specification; - @Metadata + @XmlAttribute private String apiContextPath; @XmlAttribute private String routeId; @@ -78,6 +78,10 @@ public class OpenApiDefinition extends OptionalIdentifiedDefinition<OpenApiDefin return apiContextPath; } + /** + * Whether to enable api-doc that exposes the OpenAPI specification file as a REST endpoint. This allows clients to + * obtain the specification from the running Camel application. + */ public void setApiContextPath(String apiContextPath) { this.apiContextPath = apiContextPath; } @@ -144,8 +148,8 @@ public class OpenApiDefinition extends OptionalIdentifiedDefinition<OpenApiDefin * Whether to enable api-doc that exposes the OpenAPI specification file as a REST endpoint. This allows clients to * obtain the specification from the running Camel application. */ - public OpenApiDefinition apiContextPath(String apiDoc) { - this.apiContextPath = apiDoc; + public OpenApiDefinition apiContextPath(String apiContextPath) { + this.apiContextPath = apiContextPath; return this; } diff --git a/core/camel-xml-io/pom.xml b/core/camel-xml-io/pom.xml index 5761b152798..4256346a2f7 100644 --- a/core/camel-xml-io/pom.xml +++ b/core/camel-xml-io/pom.xml @@ -170,10 +170,6 @@ <echo>Copying code together for the XSD generation</echo> <mkdir dir="${project.build.directory}/schema-src" /> <copy todir="${project.build.directory}/schema-src"> - <fileset dir="${project.basedir}/../camel-core-xml/src/main/java"> - <include name="org/apache/camel/core/xml/*.java" /> - <include name="org/apache/camel/core/xml/util/**/*.java" /> - </fileset> <fileset dir="${project.basedir}/../camel-api/src/main/java"> <include name="org/apache/camel/BeanScope.java" /> <include name="org/apache/camel/ExchangePattern.java" /> diff --git a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java index 29e35dda7f8..636325e0995 100644 --- a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java +++ b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java @@ -2661,16 +2661,14 @@ public class ModelParser extends BaseParser { } protected OpenApiDefinition doParseOpenApiDefinition() throws IOException, XmlPullParserException { return doParse(new OpenApiDefinition(), (def, key, val) -> switch (key) { + case "apiContextPath": def.setApiContextPath(val); yield true; case "disabled": def.setDisabled(val); yield true; case "missingOperation": def.setMissingOperation(val); yield true; case "mockIncludePattern": def.setMockIncludePattern(val); yield true; case "routeId": def.setRouteId(val); yield true; case "specification": def.setSpecification(val); yield true; default: yield optionalIdentifiedDefinitionAttributeHandler().accept(def, key, val); - }, (def, key) -> switch (key) { - case "apiContextPath": def.setApiContextPath(doParseText()); yield true; - default: yield optionalIdentifiedDefinitionElementHandler().accept(def, key); - }, noValueHandler()); + }, optionalIdentifiedDefinitionElementHandler(), noValueHandler()); } protected OpenIdConnectDefinition doParseOpenIdConnectDefinition() throws IOException, XmlPullParserException { return doParse(new OpenIdConnectDefinition(), (def, key, val) -> switch (key) { diff --git a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java index 58383a2414a..108707bc038 100644 --- a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java +++ b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java @@ -3375,9 +3375,9 @@ public class ModelWriter extends BaseWriter { doWriteAttribute("mockIncludePattern", def.getMockIncludePattern(), "classpath:camel-mock/**"); doWriteAttribute("missingOperation", def.getMissingOperation(), "fail"); doWriteAttribute("routeId", def.getRouteId(), null); + doWriteAttribute("apiContextPath", def.getApiContextPath(), null); doWriteAttribute("specification", def.getSpecification(), null); doWriteAttribute("disabled", def.getDisabled(), null); - doWriteElement("${n}", def.getApiContextPath(), this::doWriteString); endElement(name); } protected void doWriteOpenIdConnectDefinition(String name, OpenIdConnectDefinition def) throws IOException { diff --git a/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java b/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java index a57f93d9ec6..06757457799 100644 --- a/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java +++ b/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java @@ -3375,9 +3375,9 @@ public class ModelWriter extends BaseWriter { doWriteAttribute("mockIncludePattern", def.getMockIncludePattern(), "classpath:camel-mock/**"); doWriteAttribute("missingOperation", def.getMissingOperation(), "fail"); doWriteAttribute("routeId", def.getRouteId(), null); + doWriteAttribute("apiContextPath", def.getApiContextPath(), null); doWriteAttribute("specification", def.getSpecification(), null); doWriteAttribute("disabled", def.getDisabled(), null); - doWriteElement("${n}", def.getApiContextPath(), this::doWriteString); endElement(name); } protected void doWriteOpenIdConnectDefinition(String name, OpenIdConnectDefinition def) throws IOException { diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java index e5d4a7392f0..bcafba6f5a8 100644 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java +++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java @@ -10980,6 +10980,7 @@ public final class ModelDeserializers extends YamlDeserializerSupport { description = "To use OpenApi as contract-first with Camel Rest DSL.", deprecated = false, properties = { + @YamlProperty(name = "apiContextPath", type = "string", description = "Whether to enable api-doc that exposes the OpenAPI specification file as a REST endpoint. This allows clients to obtain the specification from the running Camel application.", displayName = "Api Context Path"), @YamlProperty(name = "description", type = "string", description = "Sets the description of this node", displayName = "Description"), @YamlProperty(name = "disabled", type = "boolean", description = "Whether to disable all the REST services from the OpenAPI contract from the route during build time. Once an REST service has been disabled then it cannot be enabled later at runtime.", displayName = "Disabled"), @YamlProperty(name = "id", type = "string", description = "Sets the id of this node", displayName = "Id"), @@ -11004,6 +11005,11 @@ public final class ModelDeserializers extends YamlDeserializerSupport { String propertyName, Node node) { propertyKey = org.apache.camel.util.StringHelper.dashToCamelCase(propertyKey); switch(propertyKey) { + case "apiContextPath": { + String val = asText(node); + target.setApiContextPath(val); + break; + } case "disabled": { String val = asText(node); target.setDisabled(val); @@ -15078,7 +15084,7 @@ public final class ModelDeserializers extends YamlDeserializerSupport { @YamlProperty(name = "disabled", type = "boolean", description = "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.", displayName = "Disabled"), @YamlProperty(name = "id", type = "string", description = "Sets the id of this node", displayName = "Id"), @YamlProperty(name = "intermittent", type = "boolean", description = "Sets whether the offsets will be intermittently present or whether they must be present in every exchange", displayName = "Intermittent"), - @YamlProperty(name = "loggingLevel", type = "enum:TRACE,DEBUG,INFO,WARN,ERROR,OFF", defaultValue = "ERROR", displayName = "Logging Level"), + @YamlProperty(name = "loggingLevel", type = "enum:TRACE,DEBUG,INFO,WARN,ERROR,OFF", defaultValue = "ERROR", description = "The logging level to use in case of failures.", displayName = "Logging Level"), @YamlProperty(name = "resumeStrategy", type = "string", required = true, description = "Sets the resume strategy to use", displayName = "Resume Strategy") } ) diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json index 5f15a53ab65..a6e616c5786 100644 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json +++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json @@ -5214,6 +5214,7 @@ "loggingLevel" : { "type" : "string", "title" : "Logging Level", + "description" : "The logging level to use in case of failures.", "default" : "ERROR", "enum" : [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ] }, @@ -14965,6 +14966,11 @@ "type" : "object", "additionalProperties" : false, "properties" : { + "apiContextPath" : { + "type" : "string", + "title" : "Api Context Path", + "description" : "Whether to enable api-doc that exposes the OpenAPI specification file as a REST endpoint. This allows clients to obtain the specification from the running Camel application." + }, "description" : { "type" : "string", "title" : "Description",
