@Override
    public void writeString(int fieldNumber, CharSequence value, boolean repeated) throws IOException
    {
        final WriteSink sink = this.sink;
        if (lastNumber == fieldNumber)
        {
            // repeated
            tail = sink.writeStrUTF8(
                    value,
                    this,
                    sink.writeByteArray(
                            DASH_AND_SPACE,
                            this,
                            newLine(
                                    inc(indent, 2),
                                    sink,
                                    this,
                                    tail)));

            return;
        }

        tail = sink.writeStrUTF8(
                value,
                this,
                writeKey(
                        schema.getFieldName(fieldNumber),
                        indent,
                        repeated,
                        sink,
                        this,
                        tail));

        lastNumber = fieldNumber;
    }
Before serializing a message/object tied to a schema, this should be called.
protostuff-yaml/src/main/java/io/protostuff/YamlOutput.java