Skip to content

Unable to export ProcessGroups due to wrong (de)serialisation #354

@michaelarnauts

Description

@michaelarnauts
  • Nipyapi version: latest git HEAD
  • NiFi version: 2.0.0-M3
  • NiFi-Registry version: N/A
  • Python version: 3.12
  • Operating System: Ubuntu 24.04

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:

{"flowContents":{"identifier":"a9a4cae3-72e5-33c8-b6be-7879e79e5ded","instanceIdentifier":"2f968272-0190-1000-9f4a-82702...

Returned JSON:

{'flowContents': {'identifier': 'a9a4cae3-72e5-33c8-b6be-7879e79e5ded', 'instance...

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)

What I Did

See above

Urgency

We can't use the export_process_group API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions