You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Like you describe in your docs (https://tsoa-community.github.io/docs/error-handling.html) one can return the FieldErrors type directly if a ValidateError occurs. In my API I use those FieldErrors to create an ErrorResponse type which looks like this:
Like you describe in your docs (https://tsoa-community.github.io/docs/error-handling.html) one can return the FieldErrors type directly if a ValidateError occurs. In my API I use those FieldErrors to create an ErrorResponse type which looks like this:
As you can see ErrorDetails matches the FieldErrors. I then annotate a controller method with this response type in the case an error occurred
@response(400, "Request validation failed.")
If I then look at the generated swagger.json output it looks like this for the ErrorResponse type:
A generated client (swagger editor) typescript-axios generates this ErrorDetails type for the ErrorResponse:
Sorting
I'm submitting a ...
I confirm that I
Expected Behavior
I would expect that I can use ErrorFields as a valid response, as it is also included in the docs.
Current Behavior
Currently as already mentioned this does not generate a valid client.
Possible Solution
As a workaround I tried mapping the ErrorFields to a Map<string, X> but quickly found out that there is an open issue with Maps.
The text was updated successfully, but these errors were encountered: