Skip to content
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

Issue #188 Fix JSON Exporter for Symlink Nodes #189

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

JaimeSandoval
Copy link

@JaimeSandoval JaimeSandoval commented Feb 10, 2022

from anytree import Node, SymlinkNode
from anytree.exporter import DotExporter, JsonExporter, DictExporter
root = Node(name="root")
a = Node(name="a", parent=root)
b = Node(name="b", parent=root)
c = SymlinkNode(target=a, parent=b)
exporter = JsonExporter(indent=2, sort_keys=False)
print(exporter.export(root))

Expected Response: {'name': 'root', 'children': [{'name': 'a'}, {'name': 'b', 'children': [{'name': 'a'}]}]}
Given Response:

{
  "name": "root",
  "children": [
    {
      "name": "a"
    },
    {
      "name": "b",
      "children": [
        {
          "name": "a"
        }
      ]
    }
  ]
}

@JaimeSandoval JaimeSandoval changed the title fixes JSON exporter for SymLink Nodes Issue #188 Fix JSON Exporter for Symlink Nodes Feb 10, 2022
@coveralls
Copy link

coveralls commented Feb 10, 2022

Coverage Status

Coverage decreased (-0.006%) to 99.754% when pulling 4fac651 on JaimeSandoval:master into d63289b on c0fec0de:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants