Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong response data type in validate #316

Open
DennyWeinberg opened this issue Aug 9, 2023 · 5 comments · May be fixed by #325
Open

Wrong response data type in validate #316

DennyWeinberg opened this issue Aug 9, 2023 · 5 comments · May be fixed by #325
Labels
bug Something isn't working

Comments

@DennyWeinberg
Copy link

DennyWeinberg commented Aug 9, 2023

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
Copy link
Collaborator

atonks2 commented Aug 11, 2023

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

@DennyWeinberg
Copy link
Author

  • 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.

@atonks2
Copy link
Collaborator

atonks2 commented Aug 11, 2023

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

@adamdecaf adamdecaf added the bug Something isn't working label Aug 11, 2023
@adamdecaf
Copy link
Member

@mfdeveloper508 can you look at this?

@mfdeveloper508
Copy link
Contributor

yes, I will take it

@mfdeveloper508 mfdeveloper508 linked a pull request Sep 20, 2023 that will close this issue
@mfdeveloper508 mfdeveloper508 linked a pull request Sep 20, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants