Re: need help on json format extraction multiple deep

2017-09-06 Thread dinesh bhardwaj
Thanks Andy.

I love you man :) . I am new to start a project in clojure. Thanks for the 
help. Now, I need not go to Node.js. 

Regards
Dinesh



On Wednesday, 6 September 2017 17:06:46 UTC+5:30, Andy Fingerhut wrote:
>
> I don't know if this is the issue, but the JSON data has it spelled 
> resolvedQuery, but you spelled it differently in your Clojure code as 
> :resolvedQuerry  (two "r"s in Query instead of one)
>
> In general, using a REPL session to examine the contents of data, or good 
> old-fashioned debug print statements or logging, to print out the contents 
> of intermediate values like from your expression (get-in (json-body-request 
> request {:keywords? true :bigdecimals true}) [:body :result]) 
> :resolvedQuerry), can help debug these kinds of things.
>
> Andy
>
> On Wed, Sep 6, 2017 at 3:42 AM, dinesh bhardwaj  > wrote:
>
>> I have a json request coming as: 
>>
>> Headers:
>> //user defined headers
>> Content-type: application/json
>>
>> POST body:
>>
>> {
>> "lang": "en", 
>> "result": {
>> "parameters": {
>> "city": "Rome", 
>> "name": "Tom"
>> }, 
>> "contexts": [], 
>> "resolvedQuery": "my name is Tom", 
>>
>>  }, 
>> "action": "greetings", 
>> }, 
>>
>> }
>>
>>
>> I am ble to extract like :lang using following 
>>
>> (get-in (json-body-request request {:keywords? true :bigdecimals true}) 
>> [:body :lang])
>>
>> But I am not able to extract :resolvedQuerry. Although I am able to extract 
>> :result. I used following code , but I know i am missing something. Please 
>> help me out?  
>>
>> (get  (get-in (json-body-request request {:keywords? true :bigdecimals 
>> true}) [:body :result]) :resolvedQuerry))
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com 
>> 
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


need help on json format extraction multiple deep

2017-09-06 Thread dinesh bhardwaj
I have a json request coming as: 

Headers:
//user defined headers
Content-type: application/json

POST body:

{
"lang": "en", 
"result": {
"parameters": {
"city": "Rome", 
"name": "Tom"
}, 
"contexts": [], 
"resolvedQuery": "my name is Tom", 

 }, 
"action": "greetings", 
}, 

}


I am ble to extract like :lang using following 

(get-in (json-body-request request {:keywords? true :bigdecimals true}) [:body 
:lang])

But I am not able to extract :resolvedQuerry. Although I am able to extract 
:result. I used following code , but I know i am missing something. Please help 
me out?  

(get  (get-in (json-body-request request {:keywords? true :bigdecimals true}) 
[:body :result]) :resolvedQuerry))


-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.