Skip to content

Commit

Permalink
Document that write_json will error on unserializable types. (#5539)
Browse files Browse the repository at this point in the history
Previously it was erroneously documented that it would save them as null.
  • Loading branch information
raymoo authored and nerzhul committed Apr 8, 2017
1 parent 8c8333b commit fb4c730
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/client_lua_api.md
Expand Up @@ -712,7 +712,7 @@ Call these functions only at load time!
* `minetest.write_json(data[, styled])`: returns a string or `nil` and an error message
* Convert a Lua table into a JSON string
* styled: Outputs in a human-readable format if this is set, defaults to false
* Unserializable things like functions and userdata are saved as null.
* Unserializable things like functions and userdata will cause an error.
* **Warning**: JSON is more strict than the Lua table format.
1. You can only use strings and positive integers of at least one as keys.
2. You can not mix string and integer keys.
Expand Down
2 changes: 1 addition & 1 deletion doc/lua_api.txt
Expand Up @@ -2709,7 +2709,7 @@ These functions return the leftover itemstack.
* `minetest.write_json(data[, styled])`: returns a string or `nil` and an error message
* Convert a Lua table into a JSON string
* styled: Outputs in a human-readable format if this is set, defaults to false
* Unserializable things like functions and userdata are saved as null.
* Unserializable things like functions and userdata will cause an error.
* **Warning**: JSON is more strict than the Lua table format.
1. You can only use strings and positive integers of at least one as keys.
2. You can not mix string and integer keys.
Expand Down

0 comments on commit fb4c730

Please sign in to comment.