Prioritise custom schema in TypedException
decorator
#725
Labels
help wanted
Extra attention is needed
TypedException
decorator
#725
Bug Report / Improvement
Summary
Right now for 200/201 status codes
nestia
overridesTypedException
decorator data, setting default values instead of provided ones.Example
expected output:
current output:
Code occuring the bug
It happens because SwaggerSchemaGenerator firstly parses TypedException decorators, then comment tags and previous output is overriden by default values (only 200 status for GET, HEAD, DELETE methods, and 201 for POST, PUT, PATCH), so if you provide TypedException for 200 or 201 status, it will be overriden.
To fix this, all we need to do is to move default checks before the custom ones (move lines 102-155 to line 32) in SwaggerSchemaGenerator.ts
P.S. I tried to create PR, but got permission denied when tried to push new branch to origin.
The text was updated successfully, but these errors were encountered: