MinifyAllCli icon indicating copy to clipboard operation
MinifyAllCli copied to clipboard

Space removed in JSON values

Open drodiger opened this issue 4 years ago β€’ 4 comments

🐞 Bug Report

Describe the bug

Version 2.4.13 on VS Code 1.52.1

On JSON which has string value, space in value is removed on minify. Example { "headers": "Content-Type:application/json\nAccept: application/json", "body": "{"login":{"username": "${username}","password": "${password}"}}" } Space in values are removed on Minify. Example, after Accept:, between username, between pasword... This is after beautified, minified JSON. (problem is creted during minify operation { "headers": "Content-Type:application/json\nAccept:application/json", "body": "{"login":{"username":"${username}","password":"${password}"}}" }

Your environment

  • OS: Windows 10 MinifyAll: 2.4.13 VS Code: 1.52.1 user install

drodiger avatar Jan 14 '21 13:01 drodiger

It should work as expected, right? I mean, the space removed is not making your code wrong. If this is a JSON, then the space after the ":" is useless. Does the minified code give you any kind of problem compared to the non-minified one?

Thanks for posting out!

Josee9988 avatar Jan 14 '21 15:01 Josee9988

It should work as expected, right? I mean, the space removed is not making your code wrong. If this is a JSON, then the space after the ":" is useless. Does the minified code give you any kind of problem compared to the non-minified one?

Thanks for posting out!

Data between " and " should not be changed in any way. This is a string value. It didn't influence me for now, but there could be data, that need to preserve space. {"key":"val ue"} this should not be translated into {"key":"value"}

drodiger avatar Jan 14 '21 15:01 drodiger

BTW, I have JSON as string value. To have " inside string value, I have to use \ before ". So: "{\"login\":{\"username\": \"${username}\",\"password\": \"${password}\"}}" Bold is value that should not be checked or minified in any way.

drodiger avatar Jan 14 '21 15:01 drodiger

I will try to check it as soon as I have some free time. Thanks!

Josee9988 avatar Jan 14 '21 15:01 Josee9988