Home > Software engineering >  API responses adding "/" near of all " ' "
API responses adding "/" near of all " ' "

Time:05-22

When ı print my json_dump

{"accountNumber": 4176312, "currencyCode": "USD", "ownerName": "selman", "accountType": "individual", "balance": 0.0}

But when ı return

return make_response(jsonify(json_dump), status_code)

I see this

enter image description here

Why this ///// is coming ? How can ı solve this ?

CodePudding user response:

json_dump is, presumably, a string of JSON, (representing an object).

jsonify will convert that string to a JSON representation of that string which will cause any " in it to be escaped.

Send json_dump to the browser (where you want a JSON representation of an object).

Don't use jsonify on something that is already JSON (since a JSON representation of a JSON representation of an object isn't very useful).

  • Related