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

Response Status Codes are not the Codes defined in spec #79

Open
cebe opened this issue Feb 7, 2025 · 2 comments · Fixed by #95
Open

Response Status Codes are not the Codes defined in spec #79

cebe opened this issue Feb 7, 2025 · 2 comments · Fixed by #95
Assignees
Labels
under discussion Still discussing, not ready for implementation.

Comments

@cebe
Copy link
Member

cebe commented Feb 7, 2025

cebe#3

According to the OAS 3 Spec, status codes that are available are defined in
https://tools.ietf.org/html/rfc7231#section-6

The generated code is returning 422 for example.
https://github.com/OAI/OpenAPI-Specification/blob/3.0.2/versions/3.0.2.md#httpCodes

These code is not defined in the RFC.
If i am correct it should return 400 instead.

Or for duplicate errors: 409

@cebe cebe added the under discussion Still discussing, not ready for implementation. label Feb 7, 2025
@cebe
Copy link
Member Author

cebe commented Feb 7, 2025

not sure how to solve this, at least for the CRUD generator the codes are defined by the actions and not by the spec.

@SOHELAHMED7
Copy link
Member

For CRUD actions (RestAction/FractalAction) this is not simple. Lot of changes in this lib and maybe few change in Yii framework (422 in Yii is hard-coded. It should be made configurable) will be required.

PR #95 add docs to custom action that the action should return one of the HTTP response status code mentioned in OpenAPI spec

@cebe cebe closed this as completed in #95 Mar 12, 2025
@cebe cebe reopened this Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
under discussion Still discussing, not ready for implementation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants