-
Notifications
You must be signed in to change notification settings - Fork 730
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
Newlines in multiline string from JSON modules are emitted as escaped sequence incorrectly #14366
Comments
Is the concern here about platform differences? Including unescaped newline literals in a JSON string is not valid according to the JSON spec, but you're right that both the ARM service and Bicep will accept such templates and just treat the newline literals as if they had been escaped. One potential difference that springs to mind is that unescaped newline literals will be adapted to the platform default if you are using Git's |
Thank you for answer. I understand that escaped and unescaped literals are identical as multiline string literals in ARM template. So, I think that it is reasonable to emit escaped literals for multiline strings. For your reference, my concern was following two things:
|
Thanks for the explanation! Bicep will preserve semantic equivalence according to the JSON spec, but there's no guarantee that the formatting (non-semantic) will be preserved. I'm going to close this out, as it's behaving as expected, and I don't think we can reasonably change this. |
Bicep version
0.28.1
Describe the bug
If we use JSON modules which have multiline string (valid ARM template json), the string is built with invalid ARM Template JSON.
For example, a JSON module declares following multiline string:
When we import above module and run
az bicep build
, it will be expanded as following:The line of
"value"
should be:To Reproduce
az bicep build
to build the bicep file.Additional context
I did not deploy above built template file, so it might be valid in actual ARM API even if I and vscode extension treat as error.
The text was updated successfully, but these errors were encountered: