|
|
|
@ -133,7 +133,7 @@ class JsonSchemaObjectUnitTests { |
|
|
|
.append("description", "Must be an object defining restrictions for name, active.").append("properties", |
|
|
|
.append("description", "Must be an object defining restrictions for name, active.").append("properties", |
|
|
|
new Document("name", new Document("type", "string") |
|
|
|
new Document("name", new Document("type", "string") |
|
|
|
.append("description", "Must be a string with length unbounded-10].").append("maxLength", 10)) |
|
|
|
.append("description", "Must be a string with length unbounded-10].").append("maxLength", 10)) |
|
|
|
.append("active", new Document("type", "boolean"))); |
|
|
|
.append("active", new Document("type", "bool"))); |
|
|
|
|
|
|
|
|
|
|
|
assertThat(object().generatedDescription() |
|
|
|
assertThat(object().generatedDescription() |
|
|
|
.properties(JsonSchemaProperty.string("name").maxLength(10).generatedDescription(), |
|
|
|
.properties(JsonSchemaProperty.string("name").maxLength(10).generatedDescription(), |
|
|
|
@ -266,7 +266,7 @@ class JsonSchemaObjectUnitTests { |
|
|
|
void arrayObjectShouldRenderItemsCorrectly() { |
|
|
|
void arrayObjectShouldRenderItemsCorrectly() { |
|
|
|
|
|
|
|
|
|
|
|
assertThat(array().items(Arrays.asList(string(), bool())).toDocument()).isEqualTo(new Document("type", "array") |
|
|
|
assertThat(array().items(Arrays.asList(string(), bool())).toDocument()).isEqualTo(new Document("type", "array") |
|
|
|
.append("items", Arrays.asList(new Document("type", "string"), new Document("type", "boolean")))); |
|
|
|
.append("items", Arrays.asList(new Document("type", "string"), new Document("type", "bool")))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test // DATAMONGO-2613
|
|
|
|
@Test // DATAMONGO-2613
|
|
|
|
@ -316,7 +316,7 @@ class JsonSchemaObjectUnitTests { |
|
|
|
void booleanShouldRenderCorrectly() { |
|
|
|
void booleanShouldRenderCorrectly() { |
|
|
|
|
|
|
|
|
|
|
|
assertThat(bool().generatedDescription().toDocument()) |
|
|
|
assertThat(bool().generatedDescription().toDocument()) |
|
|
|
.isEqualTo(new Document("type", "boolean").append("description", "Must be a boolean.")); |
|
|
|
.isEqualTo(new Document("type", "bool").append("description", "Must be a boolean.")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// -----------------
|
|
|
|
// -----------------
|
|
|
|
|