I'm trying to export a ProcessGroup to JSON with the API, using the nipyapi.nifi.apis.ProcessGroupsApi().export_process_group(pg.id) API.
The current output is a Python string representation of a JSON, but this is useless, since it's not a valid JSON, and it can't be loaded with json.loads().
This is because the output format of the exportProcessGroup action is defined as a string. When I change this to object in the swagger definition and regenerate the models, it works as expected, and I get back a dict that I can convert back to a real json string to write to a file.
I notice some other API's are also defined with output as string that should probably be object (exportTemplate, exportFlowVersion)
Description
I'm trying to export a ProcessGroup to JSON with the API, using the
nipyapi.nifi.apis.ProcessGroupsApi().export_process_group(pg.id)
API.The current output is a Python string representation of a JSON, but this is useless, since it's not a valid JSON, and it can't be loaded with
json.loads()
.Actual JSON:
Returned JSON:
This is because the output format of the
exportProcessGroup
action is defined as astring
. When I change this toobject
in the swagger definition and regenerate the models, it works as expected, and I get back adict
that I can convert back to a real json string to write to a file.I notice some other API's are also defined with output as
string
that should probably beobject
(exportTemplate, exportFlowVersion)What I Did
See above
Urgency
We can't use the
export_process_group
API.