You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "saravanakumar1987 (via GitHub)" <gi...@apache.org> on 2023/02/04 07:30:35 UTC

[GitHub] [camel] saravanakumar1987 opened a new pull request, #9302: CAMEL-19009: camel-gson - Date Format with GsonBuilder

saravanakumar1987 opened a new pull request, #9302:
URL: https://github.com/apache/camel/pull/9302

   # Description
   
   PR for https://issues.apache.org/jira/browse/CAMEL-19009
   
   # Target
   
   - [ ] I checked that the commit is targeting the correct branch (note that Camel 3 uses `camel-3.x`, whereas Camel 4 uses the `main` branch)
   
   # Tracking
   - [ ] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).
   
   <!--
   # *Note*: trivial changes like, typos, minor documentation fixes and other small items do not require a JIRA issue. In this case your pull request should address just this issue, without pulling in other changes.
   -->
   
   # Apache Camel coding standards and style
   
   - [ ] I checked that each commit in the pull request has a meaningful subject line and body.
   
   <!--  
   If you're unsure, you can format the pull request title like `[CAMEL-XXX] Fixes bug in camel-file component`, where you replace `CAMEL-XXX` with the appropriate JIRA issue.
   -->
   
   - [ ] I formatted the code using `mvn -Pformat,fastinstall install && mvn -Psourcecheck`
   
   <!-- 
   You can run the aforementioned command in your module so that the build auto-formats your code and the source check verifies that is complies with our coding style. This will also be verified as part of the checks and your PR may be rejected if the checkstyle does not pass.
   
   You can learn more about the contribution guidelines at https://github.com/apache/camel/blob/main/CONTRIBUTING.md
   -->
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #9302: CAMEL-19009: camel-gson - Date Format with GsonBuilder

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9302:
URL: https://github.com/apache/camel/pull/9302#issuecomment-1416698444

   ### Components tested:
   
   | Total | Tested | Failed :x: | Passed :white_check_mark: | 
   | --- | --- | --- |  --- |
   | 1 | 1 | 1 | 1 |


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #9302: CAMEL-19009: camel-gson - Date Format with GsonBuilder

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9302:
URL: https://github.com/apache/camel/pull/9302#issuecomment-1416780584

   ### Components tested:
   
   | Total | Tested | Failed :x: | Passed :white_check_mark: | 
   | --- | --- | --- |  --- |
   | 1 | 1 | 1 | 1 |


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #9302: CAMEL-19009: camel-gson - Date Format with GsonBuilder

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9302:
URL: https://github.com/apache/camel/pull/9302#issuecomment-1416686727

   :star2: Thank you for your contribution to the Apache Camel project! :star2: 
   
   :warning: Please note that the changes on this PR may be **tested automatically**. 
   
   If necessary Apache Camel Committers may access logs and test results in the job summaries!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on a diff in pull request #9302: CAMEL-19009: camel-gson - Date Format with GsonBuilder

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #9302:
URL: https://github.com/apache/camel/pull/9302#discussion_r1096502888


##########
core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java:
##########
@@ -601,6 +614,16 @@ public Builder contentTypeHeader(boolean contentTypeHeader) {
             return this;
         }
 
+        public Builder dateFormatPattern(String dateFormatPattern) {

Review Comment:
   Can you add javadoc with: To configure the date format while marshall or unmarshall Date fields in JSON using Gson
   
   to the builder methods



##########
components/camel-gson/src/test/resources/org/apache/camel/component/gson/SpringGsonJsonDataFormatTest.xml:
##########
@@ -56,6 +57,17 @@
             <to uri="mock:reversePojo"/>
         </route>
 
+        <route>
+            <from uri="direct:inFormatDate"/>
+            <marshal><custom ref="format_date"/></marshal>
+        </route>
+		
+		<route>

Review Comment:
   Would be nice to format this XML correctly



##########
core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java:
##########
@@ -601,6 +614,16 @@ public Builder contentTypeHeader(boolean contentTypeHeader) {
             return this;
         }
 
+        public Builder dateFormatPattern(String dateFormatPattern) {

Review Comment:
   And frankly we likely forgot to do that on other builder methods. If you spot those, you are welcome to send another PR to update those.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] saravanakumar1987 commented on a diff in pull request #9302: CAMEL-19009: camel-gson - Date Format with GsonBuilder

Posted by "saravanakumar1987 (via GitHub)" <gi...@apache.org>.
saravanakumar1987 commented on code in PR #9302:
URL: https://github.com/apache/camel/pull/9302#discussion_r1096535468


##########
components/camel-gson/src/test/resources/org/apache/camel/component/gson/SpringGsonJsonDataFormatTest.xml:
##########
@@ -56,6 +57,17 @@
             <to uri="mock:reversePojo"/>
         </route>
 
+        <route>
+            <from uri="direct:inFormatDate"/>
+            <marshal><custom ref="format_date"/></marshal>
+        </route>
+		
+		<route>

Review Comment:
   Addressed



##########
core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java:
##########
@@ -601,6 +614,16 @@ public Builder contentTypeHeader(boolean contentTypeHeader) {
             return this;
         }
 
+        public Builder dateFormatPattern(String dateFormatPattern) {

Review Comment:
   Addressed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #9302: CAMEL-19009: camel-gson - Date Format with GsonBuilder

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9302:
URL: https://github.com/apache/camel/pull/9302#issuecomment-1416757392

   ### Components tested:
   
   | Total | Tested | Failed :x: | Passed :white_check_mark: | 
   | --- | --- | --- |  --- |
   | 1 | 1 | 1 | 1 |


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #9302: CAMEL-19009: camel-gson - Date Format with GsonBuilder

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9302:
URL: https://github.com/apache/camel/pull/9302#issuecomment-1416758509

   ### Components tested:
   
   | Total | Tested | Failed :x: | Passed :white_check_mark: | 
   | --- | --- | --- |  --- |
   | 1 | 1 | 1 | 1 |


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus merged pull request #9302: CAMEL-19009: camel-gson - Date Format with GsonBuilder

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #9302:
URL: https://github.com/apache/camel/pull/9302


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org