Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paste in pre-formatted JSON block

Tags:

json

paw-app

I have a lengthy block of JSON I would like to paste into the body. I see that I can import a file or paste it into the Text area. Is it possible to then convert this pasted text into JSON so I can use the nice JSON editor? When I paste it into the Text area and then switch the JSON it overwrites the body (with a warning).

I guess the ultimate question here is, how can I get a pre-built piece of JSON into the JSON editor in Paw?

A sample of the text I would paste is:

    {
  "type": "user",
  "id": "530370b477ad7120001d",
  "user_id": "25",
  "email": "[email protected]",
  "name": "Hoban Washburne",
  "remote_created_at": 1392731331,
  "updated_at": 1392734388,
  "session_count": 0,
  "last_seen_ip" : "1.2.3.4",
  "unsubscribed_from_emails": false,
  "last_request_at": 1397574667,
  "remote_created_at": 1392734387,
  "created_at": 1392734388,
  "updated_at": 1398269574,
  "session_count": 179,
  "user_agent_data": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9",
  "custom_attributes": {
    "paid_subscriber" : true,
    "monthly_spend": 155.5,
    "team_mates": 1
  }
like image 215
Spanky Avatar asked Sep 29 '22 06:09

Spanky


1 Answers

Paw normally converts Text bodies that contains JSON into a JSON object. The reason why it doesn't work here is because your JSON is missing its last } (invalid syntax). Otherwise, it should work fine.

like image 126
Micha Mazaheri Avatar answered Dec 02 '22 17:12

Micha Mazaheri