cost 262 ms
定义将在多个数据库和不同约定之间兼容的模式 - Defining a schema that will be compatible between multiple databases and different conventions

我想定义一个跨团队和平台有效的模式。 这很简单,可以被认为是一种本体论。 我需要的是能够定义该字段代表什么,并在其下定义每个平台上的字段名称。 我希望模式能够为每种使用的语言生成数据对象,因此我想知道我的需求是否可以在 Protobuf 或 GraphQL 中得到满足。注意——我的约定可能与琐碎的约 ...

我可以在 JSON 模式验证中导入表吗? - Can I import table in a JSON Schema validation?

我正在编写 JSON 模式验证。 我有一个 ID 字段,其值是从 SQL 服务器中的表导入的。 这些值很大并且经常更新,那么有没有办法在服务器中动态连接到这个表并验证 JSON? 下面是我的架构的示例代码: 代替“枚举”,我想连接到一个表,以便在更新表时更新 ID 值。 ...

jsonSchema2Pojo 如何使用 String 作为键和值生成 HashMap 作为使用模式生成的另一个 class - jsonSchema2Pojo how to generate HashMap with String as key and value as another class generated using schema

我想从 json 模式生成 POJO 类,其中生成的 class 中的属性之一应该是 map 类型 - Map<String, List>。 这里的 CustomClass 应该是使用 jsonnSchema2pojo 插件生成的 class。 我们如何在模式中实现这一点? 模式看起来 ...

JSON Schema 相对引用解析 - JSON Schema relative references resolution

我正在尝试定义一个有效的 JSON 模式,但当引用的组件位于子目录中时,我不确定如何构造引用(“$ref”)值。 我已经(详细)阅读了官方 JSON Schema 站点上的信息,并检查了来自各种 JSON Schema 解析器的测试数据,但可用信息要么不清楚要么不可用(或者,当然,我找不到它尽管搜索 ...

插件 jsonschema2pojo:属性按要求显示,但它们应该是可选的 - Plugin jsonschema2pojo: Properties are shown as required but they should be optional

我有一个personschema,其中包含例如这两个领域: 然后我有另一个扩展人模式的模​​式。 在此模式中,我希望这两个属性(birthCountry 和生日)是可选的,并且只有名称是必需的。 我试过这样: 但不幸的是,在 API-Docs 中,它们仍然被标记为强制性的。 ...

JsonSchema2Pojo,出生日期是用类型号生成的,我试图以整数形式传递值 - JsonSchema2Pojo, Date of Birth is generating with Type Number, I am trying to pass the value in Integer

我目前正在使用 JsonSchema2Pojo 生成 Pojo 类,我的 json 模式有几个与出生日期、开始日期和结束日期相关的类,这些类用类型号定义,当我生成 Pojo 类时,它的类型为 Double,我无法传递int值, 例如,如果我尝试将出生日期设置为 1/1/2020,它会显示“Requ ...

Android 存储嵌套的 JSON 对象来自 Api 调用 Z283F4AC146A612FABB50409AZ4 - Android store nested JSON Objects from Api call to Sqlite

如何将具有其他对象作为实例变量的 Object 存储在 android SQLite 数据库中。 基本上,我的 JSON 响应来自 Rest Api 调用看起来像: 这是公告 Object 的一部分,但有些人没有如上所示的材料 object。 问题不在于所有公告都有材料 object 等等,因此单 ...

枚举没有被 jsonschema2pojo-maven-plugin 正确生成 - Enum not getting generated correctly by jsonschema2pojo-maven-plugin

我在请求的 json 模式中有以下字段: 我使用 jsonschema2pojo-maven-plugin 来使用这个 json schmea 生成 java 类。 这会正确生成 java pojo,其中正确添加了此枚举,如下所示: 现在,根据新的要求,我新增了一个新的枚举值“1”,这是一个 ...

使用 jsonschema2pojo 只创建列表<object> , 没有更复杂的<div id="text_translate"><p>我正在尝试使用 jsonschema2pojo 生成 java 个对象,但我的对象数组只是生成一个List<Object>而不是一个新的映射 object。我需要提供配置设置吗?</p><p> 在下面的示例中,我期待一个OtherLanguages POJO 和一个public List<Object> otherLanguages; 场地。</p><p> 例如 JSON:</p><pre class="lang-json prettyprint-override"> { "firstName": "testfirst", "lastName": "testlast", "birthCountry": { "value": 3, "label": "Afghanistan (AF)" }, "otherLanguages": [{ "value": 218, "label": "Uzbek (UZB)" }, { "value": 216, "label": "Ukrainian (UKR)" } ] }</pre><p> 结果模式(使用<a href="https://jsonschema.net" rel="nofollow noreferrer">https://jsonschema.net</a>生成):</p><pre class="lang-json prettyprint-override"> { "$schema": "http://json-schema.org/draft-07/schema", "$id": "http://example.com/example.json", "type": "object", "title": "The root schema", "properties": { "firstName": { "$id": "#/properties/firstName", "type": "string", "title": "The firstName schema" }, "lastName": { "$id": "#/properties/lastName", "type": "string", "title": "The lastName schema" }, "birthCountry": { "$id": "#/properties/birthCountry", "type": "object", "title": "The birthCountry schema", "properties": { "value": { "$id": "#/properties/birthCountry/properties/value", "type": "integer", "title": "The value schema" }, "label": { "$id": "#/properties/birthCountry/properties/label", "type": "string", "title": "The label schema" } }, "additionalProperties": false }, "otherLanguages": { "$id": "#/properties/otherLanguages", "type": "array", "title": "The otherLanguages schema", "items": { "$id": "#/properties/otherLanguages/items", "anyOf": [ { "$id": "#/properties/otherLanguages/items/anyOf/0", "type": "object", "title": "The first anyOf schema", "properties": { "value": { "$id": "#/properties/otherLanguages/items/anyOf/0/properties/value", "type": "integer", "title": "The value schema" }, "label": { "$id": "#/properties/otherLanguages/items/anyOf/0/properties/label", "type": "string", "title": "The label schema" } }, "additionalProperties": false } ] } } }, "additionalProperties": false }</pre><p> 生成的 POJO(来自<a href="http://www.jsonschema2pojo.org/" rel="nofollow noreferrer">http://www.jsonschema2pojo.org/</a>站点,未选择任何选项)</p><pre class="lang-java prettyprint-override"> -----------------------------------com.example.BirthCountry.java----------------------------------- package com.example; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * The birthCountry schema * <p> * * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "value", "label" }) public class BirthCountry { /** * The value schema * <p> * * */ @JsonProperty("value") public Integer value; /** * The label schema * <p> * * */ @JsonProperty("label") public String label; } -----------------------------------com.example.Example.java----------------------------------- package com.example; import java.util.List; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * The root schema * <p> * * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "firstName", "lastName", "birthCountry", "otherLanguages" }) public class Example { /** * The firstName schema * <p> * * */ @JsonProperty("firstName") public String firstName; /** * The lastName schema * <p> * * */ @JsonProperty("lastName") public String lastName; /** * The birthCountry schema * <p> * * */ @JsonProperty("birthCountry") public BirthCountry birthCountry; /** * The otherLanguages schema * <p> * * */ @JsonProperty("otherLanguages") public List<Object> otherLanguages = null; }</pre></div></object> - using jsonschema2pojo only creates List<Object>, nothing more complex

我正在尝试使用 jsonschema2pojo 生成 java 个对象,但我的对象数组只是生成一个List&lt;Object&gt;而不是一个新的映射 object。我需要提供配置设置吗? 在下面的示例中,我期待一个OtherLanguages POJO 和一个public List&lt;Obj ...


 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM