Skip to content

Commit

Permalink
改进文档中不能使用的案例。
Browse files Browse the repository at this point in the history
  • Loading branch information
MoshiCoCo authored and wenshao committed Sep 19, 2023
1 parent 6902bfa commit 08daae9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/json_schema_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ JSONSchemaBenchmark.networknt thrpt 5 2.337 ± 0.007 ops/ms
@Test
public void test() {
// 定义必须包含longitude和latitude两个属性,其中longitude的取值范围是[-180 ~ 180],latitude的取值范围是[-90, 90]
JSONSchema schema = JSONSchema.of("{\n" +
" \"type\": \"object\",\n" +
" \"properties\": {\n" +
" \"longitude\": { \"type\": \"number\", \"minimum\":-180, \"maximum\":180},\n" +
" \"latitude\": { \"type\": \"number\", \"minimum\":-90, \"maximum\":90},\n" +
" },\n" +
" \"required\": [\"longitude\", \"latitude\"]\n" +
"}");
JSONSchema schema = JSONSchema.of(JSON.parseObject("{" +
" \"type\": \"object\"," +
" \"properties\": {" +
" \"longitude\": { \"type\": \"number\", \"minimum\":-180, \"maximum\":180}," +
" \"latitude\": { \"type\": \"number\", \"minimum\":-90, \"maximum\":90}," +
" }," +
" \"required\": [\"longitude\", \"latitude\"]" +
"}"));

// 校验JSONObject对象,校验通过
assertTrue(
Expand Down

0 comments on commit 08daae9

Please sign in to comment.