    @Test
    public void list_checksThatSubobjectUnionDiscriminatorAttributeExists() throws Exception {

        Exception e = assertThrows(InvalidSchemaException.class,
                () -> schema(field("name", string()),
                        field("config", union("type"))
                ));
        assertEquals("Discriminator attribute 'type' not present.", e.getMessage());
    }