Repository navigation
Large Integers Corrupted by the JSONRenderer #9547
Answered
by
aayushostwal
Corban-Lee
asked this question in
Potential Issue
Replies: 3 comments 4 replies
|
Can you tell me how I can reproduce the issue? |
1 reply
I would suggest looking further to confirm this. |
2 replies
|
I just tried to replicate this issue, just made slight changes. path("server/<int:pk>/", ServerView.as_view()),But after this changes, I have tried for I would require more insights on how you have coded this app. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I store Discord server ID's as primary keys for an object in my database, which is either Sqlite or Postgresql depending on my environment being production or development.
Storing and retrieving these integers is trivial and works without issue, including when fetching them through the DRF API web interface, however the JSON interface for retrieving data corrupts these integers.
Visual Representation (the primary key field is "id"):
In the second image, the primary key ("id") has been corrupted, so that the last 2 digits are rounded down to
00.I was able to overcome this issue with a custom JSON renderer, that casts large integers to strings, however this issue should probably be addressed within DRF itself.
As for the root of the issue, I strongly believe it's related to the json standard library in python, although I haven't looked further to confirm this.All reactions