Closed
Description
Elastic.Clients.Elasticsearch version: 8.14.6
Elasticsearch version: 8.14.3
.NET runtime version: all
Operating system version: all
Description of the problem including expected versus actual behavior:
The ToCamelCase
extension as backup of the DefaultFieldNameInferrer
doesn't work like the CamelCase namigs of System.Text.Json
or Newtonsoft.Json
. For example a property named DBName
ends as dBName
instead of dbName
.
This behavior ends in exceptions if you use strict mapping.
Steps to reproduce:
var settings = ***
var client = new ElasticsearchClient(settings);
string indexName = "test";
var createIndexResponse = await client.Indices.CreateAsync<MyDocument>(indexName, d => d
.Mappings(m => m
.Dynamic(DynamicMapping.Strict)
.Properties(p => p
.Keyword(d => d.DBName)
)
));
if (!createIndexResponse.IsSuccess())
{
if (createIndexResponse.TryGetOriginalException(out Exception ex))
throw ex;
}
var indexResponse = await client.IndexAsync(
document: new MyDocument() { DBName = "database" },
index: indexName,
id: null);
if (!indexResponse.IsSuccess())
{
if (indexResponse.TryGetOriginalException(out Exception ex))
throw ex; // throws strict_dynamic_mapping_exception
}
Expected behavior
The property name DBName
should ends as dbName
in property mapping.