Closed leherv closed 10 months ago
Hello there leherv 👋
Thank you for opening your very first issue in this project.
We will try to get back to you as soon as we can.👀
Hello again,
it seems the problem could be related to this: https://github.com/swagger-api/swagger-codegen/issues/11901. Maybe you still have a hint or advice on how I can get this to work.
Best regards
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
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.