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

make sure we format the response as json when status is 202, fixes #2245 #2258

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stalep
Copy link
Member

@stalep stalep commented Feb 6, 2025

Make sure to encode 202 responses as json.

@lampajr
Copy link
Member

lampajr commented Feb 6, 2025

Hi @stalep, I am not that sure this enough because the returned object (if we use json) should be a JSON array and not a comma separated string of ids.

Another thing is that, if we want to change from text to json, I would try to ensure the endpoint always return JSON regardless of the http code. wdyt?

NOTE: not sure but the UI might be affected by this change, in the past I had to explicitly set the content type to be tet plain otherwise the UI was failing to parse the response

@stalep stalep marked this pull request as draft February 6, 2025 12:26
@stalep
Copy link
Member Author

stalep commented Feb 6, 2025

Hi @stalep, I am not that sure this enough because the returned object (if we use json) should be a JSON array and not a comma separated string of ids.

Another thing is that, if we want to change from text to json, I would try to ensure the endpoint always return JSON regardless of the http code. wdyt?

Yes, I did not mean to do a pr here really, the idea was to make it as a draft and discuss the two points you mentions :)
I was looking at debugging the restassured objects to look at the payload last night as I was playing with the Response, but it was a bit hard to see the entire response, I need to stand up Horreum to do that more easily.

NOTE: not sure but the UI might be affected by this change, in the past I had to explicitly set the content type to be tet plain otherwise the UI was failing to parse the response

Yes, most likely which also was why I just wanted this as a draft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants