You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/08/30 05:32:49 UTC

[GitHub] [camel] calleandersson opened a new pull request #6004: Using custom Content-Type headers with RestDSL

calleandersson opened a new pull request #6004:
URL: https://github.com/apache/camel/pull/6004


   Added information about how to allow custom XML/JSon Content-Type headers when automatic binding from POJO to JSon/JAXB takes place.
   
   Changes to documentation based on discussion in the following thread:
   https://lists.apache.org/thread.html/r5e82fecd501a3b5ed25844fded1124bf2f3d48a8fdb97556dd5d0f70%40%3Cusers.camel.apache.org%3E
   
   Not sure if the information is placed at the best position in the documentation but I couldn't figure out a better place.
   
   <!-- Uncomment and fill this section if your PR is not trivial
   - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).  Trivial changes like typos do not require a JIRA issue.  Your pull request should address just this issue, without pulling in other changes.
   - [ ] Each commit in the pull request should have 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.
   - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [ ] Run `mvn clean install -Psourcecheck` in your module with source check enabled to make sure basic checks pass and there are no checkstyle violations. A more thorough check will be performed on your pull request automatically.
   Below are the contribution guidelines:
   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] davsclaus merged pull request #6004: Using custom Content-Type headers with RestDSL

Posted by GitBox <gi...@apache.org>.
davsclaus merged pull request #6004:
URL: https://github.com/apache/camel/pull/6004


   


-- 
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] oscerd commented on a change in pull request #6004: Using custom Content-Type headers with RestDSL

Posted by GitBox <gi...@apache.org>.
oscerd commented on a change in pull request #6004:
URL: https://github.com/apache/camel/pull/6004#discussion_r698216007



##########
File path: docs/user-manual/modules/ROOT/pages/rest-dsl.adoc
##########
@@ -317,6 +317,13 @@ to specify a custom content-type if the message body should not attempt to be
 marshalled using the binding. For example if the message body is a
 custom binary payload etc.
 
+When automatic binding from POJO to JSon/JAXB takes place the existing `content-type` header will by default be replaced with either `application/json` or `application/xml`. To disable the default behavior and be able to produce JSon/JAXB responses with custom `content-type` headers (e.g. `application/user.v2+json`) you configure this in Java DSL as shown below:

Review comment:
       I think it's fine as is, we could always change later. Thanks.




-- 
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] oscerd commented on a change in pull request #6004: Using custom Content-Type headers with RestDSL

Posted by GitBox <gi...@apache.org>.
oscerd commented on a change in pull request #6004:
URL: https://github.com/apache/camel/pull/6004#discussion_r698199138



##########
File path: docs/user-manual/modules/ROOT/pages/rest-dsl.adoc
##########
@@ -317,6 +317,13 @@ to specify a custom content-type if the message body should not attempt to be
 marshalled using the binding. For example if the message body is a
 custom binary payload etc.
 
+When automatic binding from POJO to JSon/JAXB takes place the existing `content-type` header will by default be replaced with either `application/json` or `application/xml`. To disable the default behavior and be able to produce JSon/JAXB responses with custom `content-type` headers (e.g. `application/user.v2+json`) you configure this in Java DSL as shown below:

Review comment:
       Maybe "you should configure" instead of "you configure"




-- 
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] calleandersson commented on a change in pull request #6004: Using custom Content-Type headers with RestDSL

Posted by GitBox <gi...@apache.org>.
calleandersson commented on a change in pull request #6004:
URL: https://github.com/apache/camel/pull/6004#discussion_r698212594



##########
File path: docs/user-manual/modules/ROOT/pages/rest-dsl.adoc
##########
@@ -317,6 +317,13 @@ to specify a custom content-type if the message body should not attempt to be
 marshalled using the binding. For example if the message body is a
 custom binary payload etc.
 
+When automatic binding from POJO to JSon/JAXB takes place the existing `content-type` header will by default be replaced with either `application/json` or `application/xml`. To disable the default behavior and be able to produce JSon/JAXB responses with custom `content-type` headers (e.g. `application/user.v2+json`) you configure this in Java DSL as shown below:

Review comment:
       I tried to be consistent with how the text was written for the example below my changes (i.e. "To enable binding you configure this in Java DSL as shown below:") but I think it looks better with "should". Should I change it or keep it as it is?




-- 
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