Ruby getting deeply nested JSON API data

前端 未结 1 1774
不知归路
不知归路 2021-01-18 04:32

I have a rails app which gets a response from World Weather Online API. I\'m using the rest-client gem and the response is in JSON format.

I parse the response using

相关标签:
1条回答
  • 2021-01-18 04:53

    You may want to look at JSONPath. It does exactly what you need. Its syntax is very similar to XPath, but JSONPath works with JSON data (as obvious).

    There is a Ruby implementation: https://github.com/joshbuddy/jsonpath

    I personally use it in every project where I need to test JSON responses.

    0 讨论(0)
提交回复
热议问题