### Question:
DocumentFormat { public static Builder newDocument() { return new Builder(); } private  DocumentFormat(Builder builder); void validateObject(JsonNode tree); static Builder newDocument();  }### Answer:
@Test public void discriminatedUnionSelectorMustBeString() { Exception e = assertThrows(InvalidSchemaException.class, () -> newDocument() .rootSchema(object( field("httpPipeline", object( field("type", integer()), field("config", union("type")) )) ) ).build()); assertThat(e.getMessage(), matchesPattern("Discriminator attribute 'type' must be a string \\(but it is not\\)")); }