You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Merge pull request #12603 from GodotExplorer/beautify-json
Add indent and sort keys support for JSON.print
This commit is contained in:
@@ -2694,12 +2694,12 @@ Variant JSONParseResult::get_result() const {
|
||||
}
|
||||
|
||||
void _JSON::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("print", "value"), &_JSON::print);
|
||||
ClassDB::bind_method(D_METHOD("print", "value", "indent", "sort_keys"), &_JSON::print, DEFVAL(String()), DEFVAL(false));
|
||||
ClassDB::bind_method(D_METHOD("parse", "json"), &_JSON::parse);
|
||||
}
|
||||
|
||||
String _JSON::print(const Variant &p_value) {
|
||||
return JSON::print(p_value);
|
||||
String _JSON::print(const Variant &p_value, const String &p_indent, bool p_sort_keys) {
|
||||
return JSON::print(p_value, p_indent, p_sort_keys);
|
||||
}
|
||||
|
||||
Ref<JSONParseResult> _JSON::parse(const String &p_json) {
|
||||
|
||||
Reference in New Issue
Block a user