在Visual Studio中转换的Logic App JSON [英] Logic App JSON transformed in Visual Studio

查看:83
本文介绍了在Visual Studio中转换的Logic App JSON的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


当我将Visual Studio 2017 Pro中的逻辑应用程序模式从Designer视图切换到代码视图时Visual Studio格式化JSON。请参阅以下代码下面的示例:

When I switch logic app mode in Visual Studio 2017 Pro from Designer View to Code View Visual Studio formats the JSON. Please see the sample below the following code:

{
    "id": "@{variables('recordId')}",
    "processingStatus": "started",
}



转换为以下内容:

Transformed into the following:

"{\"id\":\"@{variables('recordId')}\",\"status\":\"started\"}"



从功能的角度来看,两个版本都运行正常。我想知道这种转换的原因是什么?哪一个应该是首选的?

From a functional perspective, both versions are working fine. I'd like to know what is the reason of this transformation? and which one should be preferred?

推荐答案

在代码视图中,'\'字符"转义"双引号,以便将它们视为字符串文字。 设计视图将转义字符放在后面这些场景,但隐藏在用户之外。如果您更喜欢使用代码
视图,则需要在自己中设置转义字符。  
In code view, the '\' character "escapes" the double quotes so they are treated as a string literal.  The design view puts the escape characters in behind the scenes, but hides them from the user.  If you prefer to work in the code view, you will need to put the escape characters in yourself.  


这篇关于在Visual Studio中转换的Logic App JSON的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆