Skip to content
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

Closed
softzer0 opened this issue Aug 3, 2016 · 4 comments
Closed

Everything gets rendered as string in the response #4352

softzer0 opened this issue Aug 3, 2016 · 4 comments

Comments

@softzer0
Copy link

softzer0 commented Aug 3, 2016

#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?

@xordoquy
Copy link
Collaborator

xordoquy commented Aug 3, 2016

Closing this it as it isn't actionnable and too vague. Note that this only applies to exceptions.
Will consider a PR with test case though.

@xordoquy xordoquy closed this as completed Aug 3, 2016
@tomchristie
Copy link
Member

We could consider this, but I can't understand the issue from this description.

every type of variable in the exception response is rendered as a string value in JSON

Can you give an example? When wouldn't you want a string value in an error detail?

@softzer0
Copy link
Author

softzer0 commented Aug 4, 2016

@tomchristie: For example, when returning an error number and then using the comparison operator ===. It would fail on that part.

@tomchristie
Copy link
Member

Implement a custom exception handler if you want to be able to return integers as error messages.
Personally I can't see either a good use case for it, or a way of doing that, that'd be consistent with the kind error messages we return.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants