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

commit 0a05777760cbd1f965d7674d70964bc926f05876
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Thu Feb 17 16:01:52 2022 +0100

    CAMEL-17673: camel-core-model - Cleanup Rest DSL
---
 .../src/generated/resources/org/apache/camel/model/rest/rest.json | 8 ++++----
 .../resources/org/apache/camel/model/rest/restBinding.json        | 6 +++---
 .../java/org/apache/camel/model/rest/RestBindingDefinition.java   | 3 +++
 .../src/main/java/org/apache/camel/model/rest/RestDefinition.java | 4 ++++
 4 files changed, 14 insertions(+), 7 deletions(-)

diff --git 
a/core/camel-core-model/src/generated/resources/org/apache/camel/model/rest/rest.json
 
b/core/camel-core-model/src/generated/resources/org/apache/camel/model/rest/rest.json
index 4fdce04..6019f0b 100644
--- 
a/core/camel-core-model/src/generated/resources/org/apache/camel/model/rest/rest.json
+++ 
b/core/camel-core-model/src/generated/resources/org/apache/camel/model/rest/rest.json
@@ -17,10 +17,10 @@
     "consumes": { "kind": "attribute", "displayName": "Consumes", "required": 
false, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "description": "To define the content type 
what the REST service consumes (accept as input), such as application\/xml or 
application\/json. This option will override what may be configured on a parent 
level" },
     "produces": { "kind": "attribute", "displayName": "Produces", "required": 
false, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "description": "To define the content type 
what the REST service produces (uses for output), such as application\/xml or 
application\/json This option will override what may be configured on a parent 
level" },
     "bindingMode": { "kind": "attribute", "displayName": "Binding Mode", 
"required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ 
"off", "auto", "json", "xml", "json_xml" ], "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": "off", "description": "Sets the binding 
mode to use. This option will override what may be configured on a parent level 
The default value is auto" },
-    "skipBindingOnErrorCode": { "kind": "attribute", "displayName": "Skip 
Binding On Error Code", "required": false, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "autowired": false, "secret": false, 
"description": "Whether to skip binding on output if there is a custom HTTP 
error code header. This allows to build custom error messages that do not bind 
to json \/ xml etc, as success messages otherwise will do. This option will 
override what may be configured on a [...]
-    "clientRequestValidation": { "kind": "attribute", "displayName": "Client 
Request Validation", "required": false, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "autowired": false, "secret": false, 
"description": "Whether to enable validation of the client request to check: 1) 
Content-Type header matches what the Rest DSL consumes; returns HTTP Status 415 
if validation error. 2) Accept header matches what the Rest DSL produces; 
returns HTTP Status 406 if valida [...]
-    "enableCORS": { "kind": "attribute", "displayName": "Enable CORS", 
"required": false, "type": "string", "javaType": "java.lang.String", 
"deprecated": false, "autowired": false, "secret": false, "description": 
"Whether to enable CORS headers in the HTTP response. This option will override 
what may be configured on a parent level The default value is false." },
-    "apiDocs": { "kind": "attribute", "displayName": "Api Docs", "required": 
false, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "description": "Whether to include or 
exclude the VerbDefinition in API documentation. This option will override what 
may be configured on a parent level The default value is true." },
+    "skipBindingOnErrorCode": { "kind": "attribute", "displayName": "Skip 
Binding On Error Code", "required": false, "type": "boolean", "javaType": 
"java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": false, "description": "Whether to skip binding on output if 
there is a custom HTTP error code header. This allows to build custom error 
messages that do not bind to json \/ xml etc, as success messages otherwise 
will do. This option will override wh [...]
+    "clientRequestValidation": { "kind": "attribute", "displayName": "Client 
Request Validation", "required": false, "type": "boolean", "javaType": 
"java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": false, "description": "Whether to enable validation of the 
client request to check: 1) Content-Type header matches what the Rest DSL 
consumes; returns HTTP Status 415 if validation error. 2) Accept header matches 
what the Rest DSL produces; returns  [...]
+    "enableCORS": { "kind": "attribute", "displayName": "Enable CORS", 
"required": false, "type": "boolean", "javaType": "java.lang.Boolean", 
"deprecated": false, "autowired": false, "secret": false, "defaultValue": 
false, "description": "Whether to enable CORS headers in the HTTP response. 
This option will override what may be configured on a parent level The default 
value is false." },
+    "apiDocs": { "kind": "attribute", "displayName": "Api Docs", "required": 
false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, "description": 
"Whether to include or exclude the VerbDefinition in API documentation. This 
option will override what may be configured on a parent level The default value 
is true." },
     "securityDefinitions": { "kind": "element", "displayName": "Security 
Definitions", "required": false, "type": "object", "javaType": 
"org.apache.camel.model.rest.RestSecuritiesDefinition", "deprecated": false, 
"autowired": false, "secret": false, "description": "Sets the security 
definitions such as Basic, OAuth2 etc." },
     "securityRequirements": { "kind": "element", "displayName": "Security 
Requirements", "required": false, "type": "object", "javaType": 
"org.apache.camel.model.rest.RestSecuritiesRequirement", "deprecated": false, 
"autowired": false, "secret": false, "description": "Sets the security 
requirement(s) for all endpoints." },
     "id": { "kind": "attribute", "displayName": "Id", "required": false, 
"type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "description": "Sets the id of this node" 
},
diff --git 
a/core/camel-core-model/src/generated/resources/org/apache/camel/model/rest/restBinding.json
 
b/core/camel-core-model/src/generated/resources/org/apache/camel/model/rest/restBinding.json
index 294fa8c..97f01b8 100644
--- 
a/core/camel-core-model/src/generated/resources/org/apache/camel/model/rest/restBinding.json
+++ 
b/core/camel-core-model/src/generated/resources/org/apache/camel/model/rest/restBinding.json
@@ -17,9 +17,9 @@
     "bindingMode": { "kind": "attribute", "displayName": "Binding Mode", 
"required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ 
"off", "auto", "json", "xml", "json_xml" ], "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": "off", "description": "Sets the binding 
mode to use. The default value is off" },
     "type": { "kind": "attribute", "displayName": "Type", "required": false, 
"type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "description": "Sets the class name to use 
for binding from input to POJO for the incoming data The name of the class of 
the input data. Append a to the end of the name if you want the input to be an 
array type." },
     "outType": { "kind": "attribute", "displayName": "Out Type", "required": 
false, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "description": "Sets the class name to use 
for binding from POJO to output for the outgoing data The name of the class of 
the input data. Append a to the end of the name if you want the input to be an 
array type." },
-    "skipBindingOnErrorCode": { "kind": "attribute", "displayName": "Skip 
Binding On Error Code", "required": false, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "autowired": false, "secret": false, 
"description": "Whether to skip binding on output if there is a custom HTTP 
error code header. This allows to build custom error messages that do not bind 
to json \/ xml etc, as success messages otherwise will do." },
-    "clientRequestValidation": { "kind": "attribute", "displayName": "Client 
Request Validation", "required": false, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "autowired": false, "secret": false, 
"description": "Whether to enable validation of the client request to check: 1) 
Content-Type header matches what the Rest DSL consumes; returns HTTP Status 415 
if validation error. 2) Accept header matches what the Rest DSL produces; 
returns HTTP Status 406 if valida [...]
-    "enableCORS": { "kind": "attribute", "displayName": "Enable CORS", 
"required": false, "type": "string", "javaType": "java.lang.String", 
"deprecated": false, "autowired": false, "secret": false, "description": 
"Whether to enable CORS headers in the HTTP response. The default value is 
false." },
+    "skipBindingOnErrorCode": { "kind": "attribute", "displayName": "Skip 
Binding On Error Code", "required": false, "type": "boolean", "javaType": 
"java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": false, "description": "Whether to skip binding on output if 
there is a custom HTTP error code header. This allows to build custom error 
messages that do not bind to json \/ xml etc, as success messages otherwise 
will do." },
+    "clientRequestValidation": { "kind": "attribute", "displayName": "Client 
Request Validation", "required": false, "type": "boolean", "javaType": 
"java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": false, "description": "Whether to enable validation of the 
client request to check: 1) Content-Type header matches what the Rest DSL 
consumes; returns HTTP Status 415 if validation error. 2) Accept header matches 
what the Rest DSL produces; returns  [...]
+    "enableCORS": { "kind": "attribute", "displayName": "Enable CORS", 
"required": false, "type": "boolean", "javaType": "java.lang.Boolean", 
"deprecated": false, "autowired": false, "secret": false, "defaultValue": 
false, "description": "Whether to enable CORS headers in the HTTP response. The 
default value is false." },
     "component": { "kind": "attribute", "displayName": "Component", 
"required": false, "type": "string", "javaType": "java.lang.String", 
"deprecated": false, "autowired": false, "secret": false, "description": "Sets 
the component name that this definition will apply to" },
     "id": { "kind": "attribute", "displayName": "Id", "required": false, 
"type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "description": "Sets the id of this node" 
},
     "description": { "kind": "element", "displayName": "Description", 
"required": false, "type": "object", "javaType": 
"org.apache.camel.model.DescriptionDefinition", "deprecated": false, 
"autowired": false, "secret": false, "description": "Sets the description of 
this node" }
diff --git 
a/core/camel-core-model/src/main/java/org/apache/camel/model/rest/RestBindingDefinition.java
 
b/core/camel-core-model/src/main/java/org/apache/camel/model/rest/RestBindingDefinition.java
index 163b23f..ca79f96 100644
--- 
a/core/camel-core-model/src/main/java/org/apache/camel/model/rest/RestBindingDefinition.java
+++ 
b/core/camel-core-model/src/main/java/org/apache/camel/model/rest/RestBindingDefinition.java
@@ -63,10 +63,13 @@ public class RestBindingDefinition extends 
OptionalIdentifiedDefinition<RestBind
     @XmlTransient
     private Class<?> outTypeClass;
     @XmlAttribute
+    @Metadata(javaType = "java.lang.Boolean")
     private String skipBindingOnErrorCode;
     @XmlAttribute
+    @Metadata(javaType = "java.lang.Boolean")
     private String clientRequestValidation;
     @XmlAttribute
+    @Metadata(javaType = "java.lang.Boolean")
     private String enableCORS;
     @XmlAttribute
     private String component;
diff --git 
a/core/camel-core-model/src/main/java/org/apache/camel/model/rest/RestDefinition.java
 
b/core/camel-core-model/src/main/java/org/apache/camel/model/rest/RestDefinition.java
index 85684e0a3..cadb905 100644
--- 
a/core/camel-core-model/src/main/java/org/apache/camel/model/rest/RestDefinition.java
+++ 
b/core/camel-core-model/src/main/java/org/apache/camel/model/rest/RestDefinition.java
@@ -67,12 +67,16 @@ public class RestDefinition extends 
OptionalIdentifiedDefinition<RestDefinition>
     @Metadata(defaultValue = "off", enums = "off,auto,json,xml,json_xml")
     private String bindingMode;
     @XmlAttribute
+    @Metadata(javaType = "java.lang.Boolean")
     private String skipBindingOnErrorCode;
     @XmlAttribute
+    @Metadata(javaType = "java.lang.Boolean")
     private String clientRequestValidation;
     @XmlAttribute
+    @Metadata(javaType = "java.lang.Boolean")
     private String enableCORS;
     @XmlAttribute
+    @Metadata(javaType = "java.lang.Boolean")
     private String apiDocs;
     @XmlElement(name = "securityDefinitions") // use the name Swagger/OpenAPI 
uses
     private RestSecuritiesDefinition securityDefinitions;

Reply via email to