moov-io / imagecashletter

X9’s Specifications for ICL (Image Cash Letter) to provide Check 21 services. The HTTP server is available in a Docker image and the Go package is available.
https://moov-io.github.io/imagecashletter/
Apache License 2.0
63 stars 39 forks source link

Wrong response data type in validate #316

Open DennyWeinberg opened 1 year ago

DennyWeinberg commented 1 year ago

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

atonks2 commented 1 year ago

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

DennyWeinberg commented 1 year ago

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.

atonks2 commented 1 year ago

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

adamdecaf commented 1 year ago

@mfdeveloper508 can you look at this?

mfdeveloper508 commented 1 year ago

yes, I will take it