private void setAppend() {
            if (mode == ArrayMode.INDEX && elements.size() > 0) {
                throw new IllegalStateException("Cannot append elements to an array in index mode with more than one element");
            }
            mode = ArrayMode.APPEND;
        }
Try to set append mode, but do some checking if indexed mode has been used first.
config/src/main/java/com/yahoo/vespa/config/ConfigPayloadBuilder.java