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

Status code from controller it's just ignored #85

Open
glorand opened this issue Feb 10, 2023 · 2 comments
Open

Status code from controller it's just ignored #85

glorand opened this issue Feb 10, 2023 · 2 comments

Comments

@glorand
Copy link

glorand commented Feb 10, 2023

In documentation:
"Even if the schema defines a status code, you must supply the status code in the controller method attributes, or only one response will be included in the result."

Even if I define a custom status code in controller level it's just ignored

@indigoram89
Copy link

the same bug

@vovanwin
Copy link

hi, I ran into this error, maybe you, like me, had a statically registered return response code in the "Response" class.

If you specify "ok" in the response, it doesn't matter what is specified in the attribute above the method, the responses will overwrite each other.

this returns the code 200
return Response::ok() ->description('users list') ->content( MediaType::json()->schema($response) );

this returns the code 422
return Response::unprocessableEntity() ->description('users list') ->content( MediaType::json()->schema($response) );

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

No branches or pull requests

3 participants