将一个JSON模式映射到另一个JSON模式

编程入门 行业动态 更新时间:2024-10-09 05:17:58
本文介绍了将一个JSON模式映射到另一个JSON模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一堆JSON文件,数千种不同的模式.使用 GenSON(Python JSON模式生成器),我设法为每个输入文件.现在,我想做的就是将所有这些不同的文件标准化为一个已定义的模式.这是一个示例:

I have a bunch of JSON files, thousands of different schemas. Using GenSON (the Python JSON schema generator), I managed to create schema files for each of the input files. Now, what I'd like to do is standardize all these different files to one defined schema. Here's an example:

输入

{ "name": "Bob Odenkirk", "title": "Software Engineer", "location": { "locality": "San Francisco", "region": "CA", "country": "United States" }, "age": 62, "status": "Active" }

输出

{ "names": ["Bob Odenkirk"], "occupations": ["Software Engineer"], "locations": ["San Francisco, CA"] }

本质上,我正在寻找一种语言不可知的方法(即,我不在乎使用哪种编程语言)来定义应如何将输入JSON文件解析为输出JSON文件.

Essentially, I am looking for a language agnostic method (i.e., I don't care what programming language is used) of defining how an input JSON file should be parsed to an output JSON file.

推荐答案

URL github /bazaarvoice/jolt#jolt 说Jolt可能就是您想要的东西.

The url github/bazaarvoice/jolt#jolt says that Jolt may be what you're looking for.

震动

用Java编写的JSON到JSON转换库,其中转换的规范"本身就是JSON文档.

JSON to JSON transformation library written in Java where the "specification" for the transform is itself a JSON document.

对...有用

在将其发送给世界之前,先从ElasticSearch,MongoDb,Cassandra等转换JSON数据

Transforming JSON data from ElasticSearch, MongoDb, Cassandra, etc before sending it off to the world

从大型JSON文档中提取数据供您自己消费

Extracting data from a large JSON documents for your own consumption

更多推荐

将一个JSON模式映射到另一个JSON模式

本文发布于:2023-11-25 21:07:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1631349.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:模式   JSON

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!