private InvalidJsonException createInvalidTypeException(Type... expected) {
        var expectedTypesString = Arrays.stream(expected).map(this::toString).collect(joining("' or '", "'", "'"));
        var pathString = path.isEmpty() ? "JSON" : "JSON member '%s'".formatted(path);
        return new InvalidJsonException(
                "Expected %s to be a %s but got '%s'"
                        .formatted(pathString, expectedTypesString, toString(inspector.type())));
    }
@return true if the JSON field was present but its value was 'null'
vespajlib/src/main/java/ai/vespa/json/Json.java