imagecashletter icon indicating copy to clipboard operation
imagecashletter copied to clipboard

Wrong response data type in validate

Open DennyWeinberg opened this issue 2 years ago • 5 comments

I use the validate API and get the following response content: "{\"error\": null}"

The problem is that it is a string, but it should be a json.

Complete response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Wed, 09 Aug 2023 09:07:39 GMT
Content-Length: 20
Connection: close

"{\"error\": null}"

In my python code I need to do the following (requests is used):

    response_data = response.json()

    return json.loads(response_data)  # Again a json loads

Note that this issue exists in ICL and WIRE, not in ACH.

Issue in WIRE

DennyWeinberg avatar Aug 09 '23 09:08 DennyWeinberg

Thanks for documenting this @DennyWeinberg. Can you share some steps with us to reproduce the issue?

atonks2 avatar Aug 11 '23 15:08 atonks2

  • open the icl swagger api
  • copy the example body on the create api
  • do a post on the create api using the example body
  • extract the id from the response
  • do a post on the validate api using the id
  • see that it's not a proper json string but a json string in a string, probably

I imagine its wrongly returned in the rest api wrapper. Somehow the json is text encoded again. I'm sure it's not my mistake because only for icl and wire I need to do the double jaon load, not for icl.

Sorry, I don't have a scratch to prove it just like that.

DennyWeinberg avatar Aug 11 '23 15:08 DennyWeinberg

No worries! Those steps are exactly what I was looking for, thank you.

atonks2 avatar Aug 11 '23 15:08 atonks2

@mfdeveloper508 can you look at this?

adamdecaf avatar Sep 15 '23 20:09 adamdecaf

yes, I will take it

mfdeveloper508 avatar Sep 18 '23 14:09 mfdeveloper508