You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by fabryprog <fa...@bizmate.it> on 2016/05/30 09:49:11 UTC
Camel 2.17.x, null values are gone
Hello,
i upgrade my camel version from 2.16.3 to 2.17.0
Server side, I am using rest component + json.
Now I have a problem, in this version my json null values are gone!
Before camel upgrade i can send follow json
{ "first": "hello", "second": null, "third": "everyone" }
into camel 2.17.0 my json is:
{ "first": "hello", "third": "everyone" }
Where is my null value?
I just upgrade camel version, do you changed the default settings?
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-17-x-null-values-are-gone-tp5783253.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel 2.17.x, null values are gone
Posted by fabryprog <fa...@bizmate.it>.
my solution is:
<dataFormatProperty key="json.in.disableFeatures"
value="WRITE_NULL_MAP_VALUES" />
Please, insert this line into official documentation for backward
compatibility!
king regards!
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-17-x-null-values-are-gone-tp5783253p5783274.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel 2.17.x, null values are gone
Posted by souciance <so...@gmail.com>.
Ok so you are using the camel REST dsl. It uses Jackson by default.
Probably you need to include a Jackson parameter in your config which
allows null values. See the doc:
https://camel.apache.org/rest-dsl.html
and here:
http://www.baeldung.com/jackson-ignore-null-fields
On Mon, May 30, 2016 at 6:35 PM, fabryprog [via Camel] <
ml-node+s465427n5783260h23@n5.nabble.com> wrote:
> Everything is configured in this way by camel spring DSL
>
> camelContext
>
> <restConfiguration bindingMode="auto" component="servlet"
> enableCORS="true" >
> <dataFormatProperty key="prettyPrint"
> value="true"/>
> <apiProperty key="cors" value="true" />
> <corsHeaders key="Access-Control-Allow-Headers"
> value="Origin, Accept, X-Requested-With, Content-Type,
> Access-Control-Request-Method, Access-Control-Request-Headers,
> Authorization" />
> </restConfiguration>
> </restConfiguration>
>
> Simple REST DSL
>
> <post uri="/user" produces="application/json">
> ....
> </post>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Camel-2-17-x-null-values-are-gone-tp5783253p5783260.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h31@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-17-x-null-values-are-gone-tp5783253p5783261.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel 2.17.x, null values are gone
Posted by fabryprog <fa...@bizmate.it>.
Everything is configured in this way by camel spring DSL
camelContext
<restConfiguration bindingMode="auto" component="servlet" enableCORS="true"
>
<dataFormatProperty key="prettyPrint" value="true"/>
<apiProperty key="cors" value="true" />
<corsHeaders key="Access-Control-Allow-Headers" value="Origin, Accept,
X-Requested-With, Content-Type, Access-Control-Request-Method,
Access-Control-Request-Headers, Authorization" />
</restConfiguration>
</restConfiguration>
Simple REST DSL
<post uri="/user" produces="application/json">
....
</post>
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-17-x-null-values-are-gone-tp5783253p5783260.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel 2.17.x, null values are gone
Posted by souciance <so...@gmail.com>.
Yes, but what json framework do you use on the camel side to parse the json
you send from the client?
On Mon, May 30, 2016 at 2:10 PM, fabryprog [via Camel] <
ml-node+s465427n5783257h30@n5.nabble.com> wrote:
> camel (server side ) + angular (client side)
>
> i just upgrade camel version!
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Camel-2-17-x-null-values-are-gone-tp5783253p5783257.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h31@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-17-x-null-values-are-gone-tp5783253p5783259.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel 2.17.x, null values are gone
Posted by fabryprog <fa...@bizmate.it>.
camel (server side ) + angular (client side)
i just upgrade camel version!
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-17-x-null-values-are-gone-tp5783253p5783257.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel 2.17.x, null values are gone
Posted by souciance <so...@gmail.com>.
Which json framework are you using?
On Mon, May 30, 2016 at 11:49 AM, fabryprog [via Camel] <
ml-node+s465427n5783253h6@n5.nabble.com> wrote:
> Hello,
>
> i upgrade my camel version from 2.16.3 to 2.17.0
>
> Server side, I am using rest component + json.
>
> Now I have a problem, in this version my json null values are gone!
>
> Before camel upgrade i can send follow json
>
> { "first": "hello", "second": null, "third": "everyone" }
>
> into camel 2.17.0 my json is:
>
> { "first": "hello", "third": "everyone" }
>
> Where is my null value?
>
> I just upgrade camel version, do you changed the default settings?
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Camel-2-17-x-null-values-are-gone-tp5783253.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h31@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-17-x-null-values-are-gone-tp5783253p5783255.html
Sent from the Camel - Users mailing list archive at Nabble.com.