HttpService:JSONEncode has outdated documentation about cyclic tables

Reproduction Steps
To reproduce the issue, a trimmed version of the example code on the webpage can be used. Execute this in the command bar:

local tbl = {
   Key = "Key"
}
tbl.Cycle = tbl
print(game:GetService("HttpService"):JSONEncode(tbl))

Expected Behavior
According to the documentation, the output should define the JSON such that "Cycle" : "*** certain entries belong to the same table ***" is included in the output string.


image

Actual Behavior
Instead of the documented behavior occurring, JSONEncode will instead raise an exception, preventing the JSON from being generated if it has a cyclic table within it.

image

Issue Area: DevHub Website
Page URL: HttpService | Roblox Creator Documentation
Impact: Low
Frequency: Constantly

6 Likes

Thanks for your report! We’ve triaged the issue and will follow up when it has been resolved.

3 Likes

This issue has been resolved! If you are still experiencing the issue, please allow some time for the changes to propagate.
https://developer.roblox.com/en-us/api-reference/function/HttpService/JSONEncode

2 Likes

This topic was automatically closed after 22 hours. New replies are no longer allowed.