box / boxcli

A command line interface for interacting with the Box API.
https://developer.box.com
Apache License 2.0
228 stars 59 forks source link

Backslash character "\" gets automatically escaped #485

Closed kojimaru14 closed 1 year ago

kojimaru14 commented 1 year ago

I have checked that the SDK documentation doesn't solve my issue.

I have checked that the API documentation doesn't solve my issue.

I have checked that the Box Developer Forums doesn't solve my issue.

I have searched Issues in this repo and my issue isn't already reported.

Describe the bug

When using folders command box folders:update to update the description field with the string that contains the backslash character (e.g. Test\nTest\nTest), the backslash character seems to be automatically escaped, and the request is sent with Test\\nTest\\nTest.

Because the backslash gets escaped, I'm unable to use \n to create new line characters.

When running the command box folders:update 47927266486 --description="Test\nTest\nTest", the description of the folder becomes

Test\nTest\nTest

although what I want is

Test Test Test

Expected behavior

The backslash character shouldn't have to be escaped so that the original string supplied by the user is respected.

When running the command box folders:update 47927266486 --description="Test\nTest\nTest", the description of the folder should become

Test Test Test

instead of

Test\nTest\nTest

Steps to reproduce

Run the command that contains "\n" within the parameter.

e.g.

 box folders:update 47927266486 --description="Test\nTest\nTest"

Authentication method used in your application

Server Authentication (with JWT)

App Access Level

App + Enterprise Access

What is Box CLI Version and Node used?

@box/cli/3.5.0 win32-x64 node-v14.19.3

What is your Operating System Version?

Windows

antusus commented 1 year ago

Hello @kojimaru14 , I can replicate this error. Thanks for all the details. I suspect this is box-node-sdk problem but I'll verify and we will work on a fix. Will let you know once we have this solved.

arjankowski commented 1 year ago

Hi @kojimaru14, Thanks for reporting this issue! We've just released a new version v3.9.2 with the fix for this bug.

Best, Artur