scramble icon indicating copy to clipboard operation
scramble copied to clipboard

Response body not showing when using Illuminate\Http\Response constants.

Open vzambon opened this issue 1 year ago • 3 comments

Hey,

When i use Illuminate\Http\Response HTTP status codes for better readability, the doc stops showing the response body.

response()->json(['message' => 'Foo Bar'], Response::HTTP_OK) image

vs

response()->json(['message' => 'Foo Bar'], 200) image

vzambon avatar Aug 11 '23 06:08 vzambon

@vszambon1 true! Thanks for reporting. I also can see that response structure in general is not correctly documented in such case? Because expected structure is array, {message: string}, not just string.

Will fix!

romalytvynenko avatar Aug 11 '23 07:08 romalytvynenko

@vszambon1 true! Thanks for reporting. I also can see that response structure in general is not correctly documented in such case? Because expected structure is array, {message: string}, not just string.

Will fix!

Actually the code that I used to generate the print didn't have the 'message' key, sorry for that.

vzambon avatar Aug 11 '23 08:08 vzambon

Oh, okay. So, I'll fix only constants 👾

romalytvynenko avatar Aug 11 '23 08:08 romalytvynenko