Currently, when an object is mapped with `subobjects: false`, trying to ingest a document that has nested objects leads to a mapping exception.

In a couple of occasions, we've been talking about that it would be convenient if Elasticsearch could automatically flatten the fields instead of the client having to know about the `subobjects` setting. This would make `subobjects: false` more of a drop-in replacement that allows for a much easier adoption, without changes in the client.

Note that the `_source` should ideally stay untouched, just the stored fields should be flattened automatically.

Some related issues
* https://github.com/elastic/apm/issues/347
* https://github.com/elastic/elasticsearch/issues/88777
* https://github.com/elastic/package-spec/issues/349
server/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java
} else if (token == XContentParser.Token.START_ARRAY) {
                parseArray(context, lastFieldName);
            } else if (token == XContentParser.Token.VALUE_NULL) {
                parseNullValue(context, lastFieldName);
            } else if (token == null) {
                throwEOFOnParseArray(arrayFieldName, context);
            } else {
                assert token.isValue();
                parseValue(context, lastFieldName);
            }
        }
    }
    private static void throwEOFOnParseArray(String arrayFieldName, DocumentParserContext context) {
        throw new DocumentParsingException(
            context.parser().getTokenLocation(),
            "object mapping for ["
                + context.parent().name()
                + "] with array for ["
                + arrayFieldName
                + "] tried to parse as array, but got EOF, is there a mismatch in types for the same field?"
        );
    }
    private static void parseValue(final DocumentParserContext context, String currentFieldName) throws IOException {
        if (currentFieldName == null) {
            throwOnNoFieldName(context);
        }
        Mapper mapper = getLeafMapper(context, currentFieldName);
        if (mapper != null) {
            parseObjectOrField(context, mapper);
        } else {