openapi-generator-plus-generators
openapi-generator-plus-generators copied to clipboard
Method with several status codes generates only one return
I have method that describe DELETE operation. Responses array of swagger may look like
responses:
'200':
description: Removed response with body
content:
application/json:
schema:
type: object
'204':
description: Removed response
'404':
description: Time record is not exist
content:
application/json:
schema:
type: object
When I generates it with @openapi-generator-plus/[email protected],
I have only one return and the rest are throws
if (mimeType === 'application/json') {
return response.json() as any;
}
throw response;
}
if (response.status === 204) {
throw response;
}
if (response.status === 404) {
if (mimeType === 'application/json') {
throw response;
}
throw response;
}
Expected behavior: Following the standart of status code, as for me, only 500th and 400th error codes should throw response object - the res should just return it