OMDb-API icon indicating copy to clipboard operation
OMDb-API copied to clipboard

API returns malformed JSON

Open bkline opened this issue 1 year ago • 1 comments

The response from the API is a string which is supposed to be a proper JSON serialization of the requested values. However, it's as if the service is using homemade code to generate that JSON instead of the standard library utilities found in whichever language is used to implement the service. As a result, the returned response is sometimes not correctly-formed JSON, and attempts to parse it fail. For example, according to the JSON standard, a backslash character is only allowed in a string value as part of a two-character escape sequence. However, the response for the request to retrieve the record for movie tt0120690 with the parameter plot set to "full" contains the substring "separated from inner\spiritual peace" and "\s" is not a valid escape sequence. Also, control characters are not permitted in string values, but the full plot record for tt2425542 contains a string value with an unescaped tab character (ASCII 9), and the full plot record for tt3610732 contains multiple unescaped control characters. Please use the standard tools provided by your programming language for serializing values as JSON instead of trying (unsuccessfully) to reinvent the wheel.

bkline avatar Aug 22 '24 13:08 bkline

tt596799.bogus.json is another example, with the bogus JSON attached to the ticket.

bkline avatar Aug 23 '24 15:08 bkline