Skip to content

Handle plain text response types so json values are correctly returned #358

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

Merged
merged 1 commit into from
Oct 2, 2024
Merged

Handle plain text response types so json values are correctly returned #358

merged 1 commit into from
Oct 2, 2024

Conversation

michaelarnauts
Copy link
Contributor

This change adds support for returning the actual string as it is returned by NiFi when the return type is set to str.

This fixes the exportTemplate, exportFlowVersion and exportProcessGroup API's and probably some others.

The current implementation would json.loads() the reply to a dict, and then convert that dict to a str by using str(). This doesn't generate a valid JSON however, since it will be the Python representation of a dict.

Actual returned JSON:

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

Returned JSON after (wrongful) deserialisation:

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

Fixes #354

@Chaffelson Chaffelson merged commit 6907d86 into Chaffelson:main Oct 2, 2024
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.

Unable to export ProcessGroups due to wrong (de)serialisation
3 participants