private static String toString(StructDataType dataType) {
            StringBuilder builder = new StringBuilder();
            builder.append(dataType.getName()).append(":{");
            boolean first = true;
            for (Field field : dataType.getFields()) {
                if (!first) {
                    builder.append(",");
                }
                if (field.getDataType() instanceof StructDataType) {
                    builder.append(toString((StructDataType) field.getDataType()));
                } else {
                    builder.append(field.getName() + ":" + field.getDataType().getName());
                }
                first = false;
            }
            builder.append("}");
            return builder.toString();
        }
Validates the changes between a current and next document type used in a document database.

@author toregge
config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidator.java