Custom Status Code when returning a JsonResource
#586
Closed
axelrindle
started this conversation in
Ideas
Replies: 1 comment
-
Well, I just read about Response description and that worked: /**
* MyResource
*
* @status 201
* @body MyResource
*/
return (new MyResource($instance))
->response()
->setStatusCode(201); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm customizing the Http Status Code in some endpoints when returning a
JsonResource
like the following:The generated OpenAPI spec however incorrectly shows a
200
status code in the response.Scramble should correctly infer the set status code. If that is not possible, I'd like to use
@status 201
in the function's docblock.Beta Was this translation helpful? Give feedback.
All reactions