yii2-openapi icon indicating copy to clipboard operation
yii2-openapi copied to clipboard

Response Status Codes are not the Codes defined in spec

Open ItsReddi opened this issue 6 years ago • 1 comments

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

ItsReddi avatar Oct 23 '19 11:10 ItsReddi

it should return the code you specify in your api description, but currently it simply uses Yii defaults.

cebe avatar Oct 23 '19 13:10 cebe