Python API to_json( ) doesn't populate any useful data
jasonwest08 opened this issue · 1 comments
The Python API to_json( ) function returns a JSON structure that has only populated the data of the fields but none of the properties. Each of the nodes provides a list of _field_names, but there is no such list provided for meaningful property names that would be helpful in a JSON output.
I've attached my simple hello world along with the JSON output.
Hello,
The prupose of the to_json()
method is only to return syntactic data, so all is as expected.
Note that properties sometimes take arguments (so there is nothing to evaluate without arguments), and most properties can return nodes that aren’t children: including such nodes in the JSON would make the JSON construction recurse infinitely.
Also note that _field_names
is an implementation detail: its name starts with a _
, so it is not part of the public API, it could be removed without notice in the future (i.e. it’s not supported).