我怎样才能“数据映射”两种不同的JSON结构? [英] How can I "data map" two different JSON structures?

查看:175
本文介绍了我怎样才能“数据映射”两种不同的JSON结构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在尝试寻找一个开源工具或一些知识如何编写可用于映射2种不同JSON结构的工具。



工具描述:上传2个不同的JSON结构,数据映射到另一个(例如使用拖放功能),并生成结果。



看下面的代码示例:



输入文件:



JSON 1

 {
" checked":false,
" id":1,
" name":" A green door"
}

JSON 2

 {
" isItChecked":false,
" ;识别":1,
"firstandlastname":"A Green Door"
}





现在链接元素" checked"到'isItChecked'," id"到'identification"和'name"到'firstandlastname"。



命中生成按钮,结果必须是这样的:



JSON3

 {
" checked":" {{body.isItChecked}} ",
" id":" {{body.identification}}",
" name":" {{body.firstandlastname}}"
}





希望我通过上面的例子很好地解释了我的问题,



提前致谢!









$

解决方案

您好


感谢您在此发帖。


对于您的问题,你能告诉我你是如何从jason1和jason2获得第三个jason字符串的?


我们需要一些代码来测试它。


我们正在等待您的更新。


最好的问候,


杰克


I'm trying to find an open-source tool or some knowledge how to code a tool that can be used to map 2 different JSON structures.

Tool description: upload 2 different JSON structures, data map one to another(for example with a drag-and-drop functionality), and generate an outcome.

Look code example below:

Input files:

JSON 1

{
  "checked": false,
  "id": 1,
  "name": "A green door"
}

JSON 2

{
   "isItChecked": false,
   "identification": 1,
   "firstandlastname": "A Green Door"
}


Now link element "checked" to "isItChecked", "id" to "identification" and "name" to "firstandlastname".

Hit generate button and outcome has to be something like this:

JSON3

{
 "checked":"{{body.isItChecked}}",
 "id":"{{body.identification}}",
 "name":"{{body.firstandlastname}}"
}


Hope i explained my question well by the example above,

Thanks in advance!

解决方案

Hi

Thank you for posting here.

For your question, could you tell me how did you get the third jason string from jason1 and jason2?

We need some code to test it.

We are waiting for your update.

Best Regards,

Jack


这篇关于我怎样才能“数据映射”两种不同的JSON结构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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