-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Consolidate JSON, JSONParseResults and JSONParser into JSON #44806
Conversation
In my opinion, the JSON singleton was more convenient, now you need to create a JSONParser instance every time. |
I really think that we need support for defining static functions for scripting as provided by built-in classes, see my comments on this at godotengine/godot-proposals#1101 (comment) which also happens to mention JSON, this would solve the convenience issue... |
On the other hand, a new |
051b9ea
to
32bb346
Compare
32bb346
to
f10a0bd
Compare
Rebased following merge of #44989. |
f10a0bd
to
704998f
Compare
Rebased following merge of #45737. |
704998f
to
e291d0e
Compare
Rebased following merge of #46200. |
e291d0e
to
a3e93ab
Compare
Rebased following merge of #46551. |
a3e93ab
to
d0ad2b9
Compare
d0ad2b9
to
c9f70d3
Compare
Rebased following merge of #40804. |
c9f70d3
to
796fe7c
Compare
We discussed this in a PR review meeting today and approved consolidating those APIs in one place (again, I remember this PR followed a discussion in another meeting). The only change we'd suggest is that since the new |
d1ac567
to
c35d4fc
Compare
Renames JSON.parse_string() to parse() Renames JSON.decode_data() to stringify()
c35d4fc
to
2bafcd3
Compare
Renamed |
Thanks! |
I don't understand why the engine exposed
is quite awful. |
@Faless The PR includes the addition of a
godot/core/variant/variant.cpp Lines 1842 to 1845 in 56d7126
Note: If the variable is not a godot/modules/gdscript/language_server/gdscript_language_protocol.cpp Lines 281 to 282 in 56d7126
|
@madmiraal thanks for the clarification. I had totally missed it. My apologies. |
Following #44574 (comment).
Supersedes #44574
Part of #16863
Removes
JSONParser
andJSONParseResults
.Includes renaming:
JSON::parse_string()
toparse()
JSON::decode_data()
tostringify()
Note 1:
stringify()
returns theString
instead ofError::Ok
.Note 2: Adds a
to_json_string()
method toVariant
for use within the engine.Edit: JSONParser has been renamed to JSON following PR Review meeting (comment)