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

Diferrent responses for one status code #108

Open
CrazyFreeMan opened this issue Feb 4, 2024 · 0 comments
Open

Diferrent responses for one status code #108

CrazyFreeMan opened this issue Feb 4, 2024 · 0 comments

Comments

@CrazyFreeMan
Copy link

Hi,
i trying use diferrent responses for one status code, but only one response generated, in doc:

#[OpenApi\Response(factory: ErrorUnauthenticatedResponse::class, statusCode: 401)]
#[OpenApi\Response(factory: ErrorForbiddenResponse::class, statusCode: 401)]

my code:

#[OpenApi\Operation(id: 'feedback-store', tags: ['Others'], method: 'POST')]
#[OpenApi\Parameters(factory: XParameters::class)]
#[OpenApi\RequestBody(factory: FeedbackStoreRequestBody::class)]
#[OpenApi\Response(factory: FeedbackResponse::class, statusCode: 204)]
#[OpenApi\Response(factory: CaptchaErrorResponse::class, statusCode: 422)]
#[OpenApi\Response(factory: FeedbackValidationErrorResponse::class, statusCode: 422)]
public function __invoke(FeedbackRequest $request): Response {}

What am I doing wrong?

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

1 participant