JSON Schema- Spring Boot

huangapple go评论74阅读模式
英文:

JSON Schema- Spring Boot

问题

在我的项目中,我有动态对象(具有我事先不知道的不同属性),我想为每个对象创建一个带有验证器的 JSON SCHEMA。我搜索过,但找不到一个可以做到这一点的库。我尝试使用了 "Vert x",但我必须知道属性的名称才能创建模式,而且我可以设置任意数量的验证器。有谁知道我可以使用哪个库?

英文:

In my project I have dynamic objects (with different properties that I don't know prior) and I want to create for each of them a JSON SCHEMA with validators. I searched but I couldn't find a library to do that. I tried to use "Vert x" but I have to know the properties names in order to create the schema, and I can set as many validators as I want. Does anybody know what library I can use?

答案1

得分: 1

我觉得你的问题有点令人困惑 - 你似乎想要创建一个JSON模式,但不知道其中的属性,但JSON模式是属性的定义,所以如果不知道属性,你就不能有一个模式。

你需要找到其他驱动验证的方式吗?

英文:

I find your question a bit confusing - it sounds like you want to create a json schema without knowing the attributes in it, but a json schema is the definition of the attributes, so without knowing the attributes you can't have a schema.

Do you need to find some other way to drive your validation?

huangapple
  • 本文由 发表于 2023年7月6日 16:07:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/76626754.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定