You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the jsons loaded are expected to be an array of datums. Some proponents think that this is dangerous and the top level things in a json should only be an object.
We could support both by checking whether the data is an object or array, and whether it has an 'items' key if it is an object, and iterating over data['items'] instead of data.
Actually this seems to be an ancient issue, but some frameworks like Flask by default refuse to return a json response with an array only.
Currently, the jsons loaded are expected to be an array of datums. Some proponents think that this is dangerous and the top level things in a json should only be an object.
We could support both by checking whether the data is an object or array, and whether it has an 'items' key if it is an object, and iterating over data['items'] instead of data.
Actually this seems to be an ancient issue, but some frameworks like Flask by default refuse to return a json response with an array only.
See http://incompleteness.me/blog/2007/03/05/json-is-not-as-safe-as-people-think-it-is/ and http://flask.pocoo.org/docs/security/#json-security
pallets/flask#510
The text was updated successfully, but these errors were encountered: