This relates to #86790, which added logic that generates the `index.routing_path` index setting from from field mapped as keyword and marked as time series dimension in the mapping.

This builds on top of this and should also check dynamic templates if field template definition are of type `keyword` and `time_series_dimension` attribute is enabled. The `path_match` should then be added to the `index.routing_path` index setting.

This request originated from: https://github.com/elastic/kibana/issues/141796#issuecomment-1260619212
server/src/main/java/org/elasticsearch/index/mapper/MapperService.java
throw new MapperParsingException("Failed to parse mapping: {}", e, e.getMessage());
        }
    }
    public static Mapping mergeMappings(DocumentMapper currentMapper, Mapping incomingMapping, MergeReason reason) {
        Mapping newMapping;
        if (currentMapper == null) {
            newMapping = incomingMapping;
        } else {
            newMapping = currentMapper.mapping().merge(incomingMapping, reason);
        }
        return newMapping;
    }
    private boolean assertSerialization(DocumentMapper mapper) {
        
        final CompressedXContent mappingSource = mapper.mappingSource();
        Mapping newMapping = parseMapping(mapper.type(), mappingSource);
        if (newMapping.toCompressedXContent().equals(mappingSource) == false) {
            throw new AssertionError(
                "Mapping serialization result is different from source. \n--> Source ["
                    + mappingSource
                    + "]\n--> Result ["
                    + newMapping.toCompressedXContent()
                    + "]"
            );
        }
        return true;
    }
    /**
     * Return the document mapper, or {@code null} if no mapping has been put yet
     * or no documents have been indexed in the current index yet (which triggers a dynamic mapping update)