From dedde605525fd7117c6937e9f4dd8ba188f9cc99 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2024 11:48:40 +0200 Subject: [PATCH] Synchronize `DefaultFieldNameInferrer` and `PropertyNamingPolicy` (#8362) (#8367) Co-authored-by: Florian Bernd --- .../Core/Configuration/ElasticsearchClientSettings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Core/Configuration/ElasticsearchClientSettings.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Configuration/ElasticsearchClientSettings.cs index 9be4f8fb4c2..cce890562f2 100644 --- a/src/Elastic.Clients.Elasticsearch.Shared/Core/Configuration/ElasticsearchClientSettings.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Configuration/ElasticsearchClientSettings.cs @@ -133,7 +133,7 @@ protected ElasticsearchClientSettingsBase( _sourceSerializer = sourceSerializerFactory?.Invoke(sourceSerializer, this) ?? sourceSerializer; _propertyMappingProvider = propertyMappingProvider ?? sourceSerializer as IPropertyMappingProvider ?? new DefaultPropertyMappingProvider(); - _defaultFieldNameInferrer = p => p.ToCamelCase(); + _defaultFieldNameInferrer = (_sourceSerializer is DefaultSourceSerializer dfs) ? p => dfs.Options?.PropertyNamingPolicy?.ConvertName(p) ?? p : p => p.ToCamelCase(); _defaultIndices = new FluentDictionary(); _defaultRelationNames = new FluentDictionary(); _inferrer = new Inferrer(this);