-
Notifications
You must be signed in to change notification settings - Fork 195
Description
When using the JSON model format as input to create a report I am getting an error "expecting a list of pytm.Data, item number 0 is a <class 'str'>" (line 213 in the code snippet).
https://github.com/izar/pytm/blob/679ea0df19b7b92e7d8359891d53f7ed794d54a3/pytm/pytm.py#L194-L218
My input JSON for data and flows looks like this:
"flows": [
{
"name": "Actor 1 to Actor 2",
"source": "Actor 1",
"sink": "Actor 2",
"order": 1,
"data": [
"Data"
]
},{
"name": "Actor 2 to Actor 3",
"source": "Actor 2",
"sink": "Actor 3",
"description": "Another data flow",
"data": [
]
}
],
"data": [
{
"name": "Data",
"format": "Text",
"isPII": true
}
]
Which I believe matches the JSON format when using the JSON output of the CLI tool. Below is the function which leads to calling varData when it creates the Dataflow object. It seems like the varData function doesn't deal with a list of data name strings. input.json in the tests folder doesn't have a data field in it. Since data objects are not in either the boundaries, elements or flows section of the JSON should they be dealt with using their own function e.g. decode_data?
https://github.com/izar/pytm/blob/679ea0df19b7b92e7d8359891d53f7ed794d54a3/pytm/json.py#L92-L107