JSON tranformation

Hi,

When transforming a JSON file most are working except one where I need to use double back slashes

e.g. D:\folder\folder\folder\filename

When it transforms it’s doubling the slashes. Any idea why?

Thanks

Dan

Hey Dan,

Thanks for reaching out.

I’m sorry to hear you’re running into this. This is actually a known bug. When using Structured Configuration Variables, variable substitution involving a file path works unpredictably, even when using valid JSON · Issue #6792 · OctopusDeploy/Issues · GitHub

I am going to add your thread to it as another instance of it.

You can subscribe to the issue to follow the status of it.

Please let me know if you have any other questions or concerns. Also please let me know if your bug does not appear to be the same as in the GitHub issue.

Best,
Jeremy

Hi Jeremy,

Thanks for the quick response, I’ll be sure to follow.

Regards,

Dan

1 Like

Hi Dan,

You’re very welcome!

Please let us know if you have any questions or concerns in the meantime.

Best,
Jeremy

Hey Dan,

Sorry for the potential spam. Just to confirm you’re seeing the same bug, can you please give me:

The Path in question
How it appears after the replacement
How you’d like it to appear?

Please let me know.

Best,
Jeremy

Hi Jeremy.

Path: D:\Folder\Folder\Folder\Folder\Folder\Folder\
How it appears: D:\\Folder\\Folder\\Folder\\Folder\\Folder\\Folder\\

Thanks,

Dan

Hey Dan,

Thanks for the information.

This is actually intentional and not the bug I mentioned previously. Sorry about all of the confusion.

Proper JSON has a double backslash when there is a backslash as indicated here: JSON.simple - Escaping Special Characters - Tutorialspoint

Are you finding the resulting JSON isn’t working in your use case?

Please let me know.

Best,
Jeremy

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.