egis / papertrail-python-cli

1 stars 9 forks source link

`pt export` produces broken YML if nodes have nodeTypeId #52

Closed artemv closed 7 years ago

artemv commented 7 years ago

Here's what it produced for a nodes with cabinet & division types:

--- !<Node>
tree:
  African Bank:
    Loans:
      $indexes:
      - {description: Loan ID, name: loan_id, required: true, order: 1}
      - {description: Name, name: name, required: true, order: 2}
      - {description: Surname, name: surname, order: 3}
      - {description: ID Number, name: id_number, order: 4}
      nodeTypeId: CABINET
    nodeTypeId: DIVISION

Then pt import results in this error seen in PT server log:

...
Wrapped by: org.yaml.snakeyaml.constructor.ConstructorException: Cannot create property=tree for JavaBean=com.egis.exporters.NodeExporterFactory$NodeWrapper@61ff9a59
 in 'reader', line 1, column 5:
    --- !<Node>
        ^
 in 'reader', line 3, column 3:
      African Bank:
      ^

    at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:312)

Without nodeTypeId: ... lines it works fine.