Kong / apiembed

Embeddable API code snippets for your website, blog or API documentation
https://apiembed.com
MIT License
410 stars 52 forks source link

Literals in JSON text body are invalid #25

Open Miserlou opened 7 years ago

Miserlou commented 7 years ago

For some reason, this is okay (notice the prefer_sms field):

{"cookies": [], "postData": {"mimeType": "application/json", "text": "{\"foo\": \"bar\", \"name\": \"Will Gates\", \"prefer_sms\": \"false\"}"}, "url": "http://mockbin.com/request", "queryString": [], "headers": [{"name": "Accept", "value": "application/json"}, {"name": "Content-Type", "value": "application/json"}], "method": "POST", "httpVersion": "HTTP/1.1"}

But this isn't:

{"cookies": [], "postData": {"mimeType": "application/json", "text": "{\"foo\": \"bar\", \"name\": \"Will Gates\", \"prefer_sms\": false}"}, "url": "http://mockbin.com/request", "queryString": [], "headers": [{"name": "Accept", "value": "application/json"}, {"name": "Content-Type", "value": "application/json"}], "method": "POST", "httpVersion": "HTTP/1.1"}

Even though both are valid JSON. Not sure what to do about this.