Announcement Announcement Module
No announcement yet.
Raw Json result Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Raw Json result


    Is there any way to get the raw JSON result instead of the mapping to the Java classes when retrieving data from
    the socials networks?

    Thank you

  • #2
    It's certainly something that *could* be done, but it'd be up to the individual API binding implementations to offer that. And none of them offer it.

    You could always ask the API binding for its RestTemplate and then perform the operation manually, asking for String or some other kind of output. For example:

    RestOperations rest = facebook.restOperations();
    String results = rest.getForObject("", String.class);
    May I ask what use case has you wanting raw JSON?


    • #3
      Thank you very much for all your quick and precise replies.

      We have in our application our own serializable classes using Avro ( for storing in the database.
      If we dont retrieve the raw json that means that the data will follow a wasted path:
      json - > spring social class mapping -> json creation -> our class mapping
      And also except from that it is also useful some times to store the raw data e.g. to retrieve fields in case of schema changes