Mapper_parsing_exception when indexing JSON with id property name

This is the error message:

Elasticsearch.Net.ElasticsearchClientException: 'Request failed to execute. Call: Status code 400 from: PUT /developer-api-portal/_doc/d63ec56a-c5af-4c1c-a0e0-14340658aa86. ServerError: Type: mapper_parsing_exception Reason: "failed to parse field [target.old.id] of type [float] in document with id 'd63ec56a-c5af-4c1c-a0e0-14340658aa86'. Preview of field's value: 'c7e83a25-d324-4a53-a464-c433a57360ba'" CausedBy: "Type: number_format_exception Reason: "For input string: "c7e83a25-d324-4a53-a464-c433a57360ba"""'

This is the JSON fragment that is causing the issue:

{
  "id": "c7e83a25-d324-4a53-a464-c433a57360ba",
  "type": "Admin",
  "value": "PaoloTestScope"
}

Looks like we cannot use any property with id in the property name, because Elasticsearch always treats it like a number.

We cannot change the JSON property names, because the JSON was serialized from the class Microsoft.Graph.PermissionScope, which is not under our control.

What are some workarounds that we can try?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.