syedmurtaza108 / chucker-flutter

An HTTP requests inspector inspired by Chucker Android
https://pub.dev/packages/chucker_flutter
MIT License
54 stars 32 forks source link

Extra "data" in the response #27

Closed elsenkarmaclub closed 1 year ago

elsenkarmaclub commented 1 year ago

Hello there! First of all, thank you for creating such a great library.

I have a question regarding the JSON response created by chucker. There is an extra "data" key in every response. I thought it was from our backend, but turns out, it was added by the library.

{
  "data": {
    "is_success": true,
    "status_code": "200",
    "message": "success",
    "data": {
      "name": "KarmaServe",
      "type": "store",
      "notifications": [],
      "configurations": {}
    }
  }
}

Is this intended? Any workaround to remove the additional "data" key? Since it can be misleading. Thank you 🙏

syedmurtaza108 commented 1 year ago

Hell @elsenkarmaclub Thanks for appreciating my little contribution to the community. The sole purpose of adding data key in every response was a consistent preview of API responses but now I realize it can be misleading and that is why I am removing this key and it will be available in the release.

Thanks for filing the issue.

elsenkarmaclub commented 1 year ago

Hi @syedmurtaza108 ,

I saw in request there is additional request key as well. Should we remove it as well to avoid misleading?

{
     "request": {...}
}