Repository: microsoft/kiota (csharp)

Issue:
derived class with additional data field are missing it
The following yaml description results in the alert model missing the additional data field.
This is because it's conflicting with the additional data field the parent model gets from standard generation.

This method needs to have a special case to handle that, and when the custom property name is "additionalData" add a prefix like we do when some fields conflict with native language primitives

https://github.com/microsoft/kiota/blob/b3bd7a0b8296a070d726656e2ee637d5fd2cf31f/src/Kiota.Builder/KiotaBuilder.cs#L1185

```yaml
openapi: 3.0.1
info:
  title: OData Service for namespace microsoft.graph
  description: This OData service is located at https://graph.microsoft.com/v1.0
  version: v1.0
  x-ms-generated-by:
    toolName: Microsoft.OpenApi.OData
    toolVersion: 1.0.9.0
servers:
  - url: https://graph.microsoft.com/v1.0
paths:
  '/security/alerts_v2/{alert-id}':
    description: Provides operations to manage the alerts_v2 property of the microsoft.graph.security entity.
    get:
      tags:
        - security.alert
      summary: Get alert
      description: Get the properties and relationships of an alert object.
      externalDocs:
        description: Find more info here
        url: https://learn.microsoft.com/graph/api/security-alert-get?view=graph-rest-1.0
      operationId: security.GetAlerts_v2
      responses:
        2XX:
          description: Retrieved navigation property
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/microsoft.graph.security.alert'
      x-ms-docs-operation-type: operation
components:
    microsoft.graph.entity:
      title: entity
      required:
        - '@odata.type'
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for an entity. Read-only.
        '@odata.type':
          type: string
    microsoft.graph.security.dictionary:
      title: dictionary
      required:
        - '@odata.type'
      type: object
      properties:
        '@odata.type':
          type: string
    microsoft.graph.security.alert:
      allOf:
        - $ref: '#/components/schemas/microsoft.graph.entity'
        - title: alert
          required:
            - '@odata.type'
          type: object
          properties:
            actorDisplayName:
              type: string
              description: The adversary or activity group that is associated with this alert.
              nullable: true
            additionalData:
              anyOf:
                - $ref: '#/components/schemas/microsoft.graph.security.dictionary'
                - type: object
                  nullable: true
```

Pull request description:
fixes #4224

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index eba65dc8d8..63d8b1b3b3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 ### Changed
 
 - Fixed a bug where multiple Visual Studio Code instances would make the extension install/update fail. [#3686](https://github.com/microsoft/kiota/issues/3686)
+- Fixed a bug where models properties named "additionalData" or "backingstore" would be ignored. [#4224](https://github.com/microsoft/kiota/issues/4224)
 - PREVIEW: Renamed the config commands to workspace. [#4310](https://github.com/microsoft/kiota/issues/4310)
 - PREVIEW: Moved preview configuration files to the .kiota directory. [#4310](https://github.com/microsoft/kiota/issues/4310)
 - PREVIEW: Moved the copy descriptions to dedicated folders. [#4310](https://github.com/microsoft/kiota/issues/4310)
diff --git a/src/Kiota.Builder/CodeDOM/CodeClass.cs b/src/Kiota.Builder/CodeDOM/CodeClass.cs
index a46e5c1b79..41a41061c2 100644
--- a/src/Kiota.Builder/CodeDOM/CodeClass.cs
+++ b/src/Kiota.Builder/CodeDOM/CodeClass.cs
@@ -167,7 +167,7 @@ private string ResolveUniquePropertyName(string name)
         ArgumentException.ThrowIfNullOrEmpty(serializationName);
 
         if (BaseClass is CodeClass currentParentClass)
-            if (currentParentClass.FindPropertyByWireName(serializationName) is CodeProperty currentProperty && !currentProperty.ExistsInBaseType)
+            if (currentParentClass.FindPropertyByWireName(serializationName) is CodeProperty currentProperty && !currentProperty.ExistsInBaseType && currentProperty.Kind is not CodePropertyKind.AdditionalData or CodePropertyKind.BackingStore)
                 return currentProperty;
             else
                 return currentParentClass.GetOriginalPropertyDefinedFromBaseType(serializationName);


Test patch:
diff --git a/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs b/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs
index 99ea0c4769..69d1eb4ca7 100644
--- a/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs
+++ b/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs
@@ -697,6 +697,83 @@ public async Task TrimsInheritanceUnusedModels()
         Assert.Null(modelsNS.FindChildByName<CodeClass>("AuditEvent", false)); //unused type
     }
     [Fact]
+    public async Task DisambiguatesReservedProperties()
+    {
+        var tempFilePath = Path.Combine(Path.GetTempPath(), Path.GetTempFileName());
+        await using var fs = await GetDocumentStream(@"openapi: 3.0.1
+info:
+  title: OData Service for namespace microsoft.graph
+  description: This OData service is located at https://graph.microsoft.com/v1.0
+  version: v1.0
+  x-ms-generated-by:
+    toolName: Microsoft.OpenApi.OData
+    toolVersion: 1.0.9.0
+servers:
+  - url: https://graph.microsoft.com/v1.0
+paths:
+  '/security/alerts_v2/{alert-id}':
+    get:
+      responses:
+        200:
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/microsoft.graph.alert'
+components:
+  schemas:
+    microsoft.graph.entity:
+      title: entity
+      required:
+        - '@odata.type'
+      type: object
+      properties:
+        id:
+          type: string
+        '@odata.type':
+          type: string
+    microsoft.graph.dictionary:
+      title: dictionary
+      required:
+        - '@odata.type'
+      type: object
+      properties:
+        '@odata.type':
+          type: string
+    microsoft.graph.alert:
+      allOf:
+        - $ref: '#/components/schemas/microsoft.graph.entity'
+        - title: alert
+          required:
+            - '@odata.type'
+          type: object
+          properties:
+            actorDisplayName:
+              type: string
+              nullable: true
+            additionalData:
+              anyOf:
+                - $ref: '#/components/schemas/microsoft.graph.dictionary'
+                - type: object
+                  nullable: true");
+        var mockLogger = new Mock<ILogger<KiotaBuilder>>();
+        var builder = new KiotaBuilder(mockLogger.Object, new GenerationConfiguration { ClientClassName = "Graph", OpenAPIFilePath = tempFilePath }, _httpClient);
+        var document = await builder.CreateOpenApiDocumentAsync(fs);
+        var node = builder.CreateUriSpace(document);
+        var codeModel = builder.CreateSourceModel(node);
+        var modelsNS = codeModel.FindNamespaceByName("ApiSdk.models.microsoft.graph");
+        Assert.NotNull(modelsNS);
+        var entityClass = modelsNS.FindChildByName<CodeClass>("Entity", false);
+        Assert.NotNull(entityClass);
+        var additionalDataProperty = entityClass.FindChildByName<CodeProperty>("AdditionalData", false);
+        Assert.NotNull(additionalDataProperty);
+        Assert.True(additionalDataProperty.Kind is CodePropertyKind.AdditionalData);
+        var alertClass = modelsNS.FindChildByName<CodeClass>("Alert", false);
+        Assert.NotNull(alertClass);
+        var additionalDataEscapedProperty = alertClass.FindChildByName<CodeProperty>("AdditionalDataProperty", false);
+        Assert.NotNull(additionalDataEscapedProperty);
+        Assert.True(additionalDataEscapedProperty.Kind is CodePropertyKind.Custom);
+    }
+    [Fact]
     public async Task TrimsInheritanceUnusedModelsWithUnion()
     {
         var tempFilePath = Path.Combine(Path.GetTempPath(), Path.GetTempFileName());