serpapi / public-roadmap

Public Roadmap for SerpApi, LLC (https://serpapi.com)
50 stars 4 forks source link

[Google Scholar API] Missing Value for `cited_by.total` Key #1676

Open schaferyan opened 3 months ago

schaferyan commented 3 months ago

A user reported the JSON response returned for their Google Scholar search couldn't be validated by a JSON parser. This appears to be due to a missing value. It appears that when results don't have the "Cited By" field, we include the cited_by key in the response without a value.

We should either omit the key or provide a value of 0 to ensure valid JSON and prevent validation errors on the user's side.

Screenshot 2024-06-11 at 11 34 22 AM Screenshot 2024-06-11 at 11 33 55 AM

Intercom | Inspector

Freaky commented 3 months ago

Unfortunately the prettified rendering of JSON in the Playground isn't generally valid JSON - it's intended for human consumption, and so makes concessions to make it easier to read. In particular, newlines and quotes in strings are displayed without escapes. null rendering could certainly do with actually displaying null, though.

Show raw JSON selected from the "Tools" menu, can be used to view the underlying JSON which can be copied and pasted directly into a parser:

1676-raw-json

Perhaps we could offer a Copy button that injects the raw JSON into the clipboard.