[英]Generate java interfaces from JSON Schema
I'm looking for tool to work with JSON Schema in java. 我正在寻找在Java中使用JSON Schema的工具。
Main requirement is interface generation. 主要要求是接口生成。 I'd like to get interfaces from parser API and provide my own implementations to serializer API.
我想从解析器API获取接口,并为序列化器API提供自己的实现。 The main purpose is to avoid beans pollution with annotations like
JsonProperty
, JsonIgnore
and so on. 主要目的是避免使用
JsonProperty
, JsonIgnore
等注释来污染豆子。
There are many tools that can generate java beans (classes) from JSON Schema. 有很多工具可以从JSON Schema生成Java bean(类)。 Jackson has a feature
@JsonSerialize(as=MyInterface.class)
, but I could not find any tools to generate interfaces from schema. 杰克逊具有
@JsonSerialize(as=MyInterface.class)
,但是我找不到从架构生成接口的任何工具。
I've never used it, but does http://www.jsonschema2pojo.org/ help? 我从未使用过它,但是http://www.jsonschema2pojo.org/有帮助吗? It seems you can even use it from within Java .
看来您甚至可以在Java中使用它 。
Let me show you how to dev the tool.you can do so: 让我向您展示如何开发该工具。您可以这样做:
I dev a tool solve the problem.it is well design and quick more. 我开发了一个工具来解决问题。它设计精良,而且速度更快。 get the code from my github .
从我的github获取代码。
enjoy it from here,I have deploy it on webserver . 从这里开始享受它,我已经将它部署在了Web服务器上 。
I try the top 2 answer's suggestion.one web is can not open.one is slower than my tool.hope you will enjoy my tool. 我尝试了前2个答案的建议。一个网无法打开。一个比我的工具慢。希望您会喜欢我的工具。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.