我正试图为JsonNode对象创建示例。 这是课程。
public class DatasetInfo {
@Getter @Setter @JsonProperty
@Schema(description = "ID", example = "12345")
private String id;
@Getter @Setter @JsonProperty
@Schema(description = "Dataset definition", example = "{\n" +
" \"name\": \"tom\",\n" +
" \"description\": \"test\"\n" +
" }")
private JsonNode result;
}
我大摇大摆地检查了一下。该示例显示:
{
"id": "a",
"name": "abc",
"result": {
"array": true,
"null": true,
"number": true,
"containerNode": true,
"missingNode": true,
"object": true,
"valueNode": true,
"pojo": true,
"boolean": true,
"long": true,
"textual": true,
"integralNumber": true,
"binary": true,
"short": true,
"int": true,
"double": true,
"float": true,
"nodeType": "ARRAY",
"bigDecimal": true,
"bigInteger": true,
"floatingPointNumber": true
}
}
它列出了所有可能的json节点,这不是预期的。我期望的例子是这样的:
{
"id": 12345",
"result": {
"name": "tom",
"description": "test"
}
}
如何创建此示例?