Skip to content
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

When importing a channel via the api linefeeds get lost in all scripts #4391

Closed
Loki-Afro opened this issue May 27, 2020 · 2 comments
Closed

Comments

@Loki-Afro
Copy link

Loki-Afro commented May 27, 2020

When exporting a channel through the ui and then importing it via the api by using curl for example the line feeds get lost.

Just to make things clear: that happens to every line of code and breaks a lot of things

example curl

        curl --insecure \
                -X POST \
                -H  "accept: application/json" \
                -H  "Content-Type: application/xml" \
                "https://localhost:8443/api/channels" \
                -d "@$channel_file"

relevant part in this example:

....
  <preprocessingScript>// Modify the message variable below to pre process data
return message;</preprocessingScript>
  <postprocessingScript>// This script executes once after a message has been processed
// Responses returned from here will be stored as &quot;Postprocessor&quot; in the response map
return;</postprocessingScript>
....

before export:
before_export

after import via api:
after_import

This happens because a different deserialization process happens when it comes directly via the api.

Is there any known workaround or fix available?

@cturczynskyj
Copy link
Collaborator

Try using --data-binary "@$channel_file" instead of -d "@$channel_file"

@Loki-Afro
Copy link
Author

@cturczynskyj great! that actually solved the issue, thank you

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

No branches or pull requests

2 participants