-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Everything gets rendered as string in the response #4352
Comments
Closing this it as it isn't actionnable and too vague. Note that this only applies to exceptions. |
We could consider this, but I can't understand the issue from this description.
Can you give an example? When wouldn't you want a string value in an error detail? |
@tomchristie: For example, when returning an error number and then using the comparison operator |
Implement a custom exception handler if you want to be able to return integers as error messages. |
#3908 - this fix ensures that every type of variable in the exception response is rendered as a string value in JSON. I know that there's a workaround for avoiding that but it's rather "non-robust" (because it requires overriding
init
), and I just think it's strange to enforce string for all fields without any specific reason. Therefore, can that function be made in more conventional way, e.g. to skip conversion of numbers to strings?The text was updated successfully, but these errors were encountered: