英文:
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?
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论