microsoft / microsoft/kiota

GetBackingStore gets emitted for models interfaces when it shouldn't

Open
#7,195 0 comments 1 reaction 1 assignee Assigned to @Copilot View on GitHub
Go status:waiting-for-triage type:bug
Dominant language
C#
Stars
3.8k
Forks
333
Avg merge
16h 29m
Merged PRs (30d)
116

Description

### What are you generating using Kiota, clients or plugins?

API Client/SDK

### In what context or format are you using Kiota?

Nuget tool

### Client library/SDK language

Go

### Describe the bug

When generating a Go client with the backing store enabled, the GetBackingStore method gets emitted for the model interface when it is already defined in the BackedModel interface it already composes from.

This is redundant, making the compile time longer and leading to "heavier" binaries. (unless the Go compiler does some kind of smart trimming).

See this example in the Microsoft Graph SDK.
https://github.com/microsoftgraph/msgraph-sdk-go/blob/2182e2493cff7e52e6f2273416f25f43c9fb2888/models/photo.go#L428

### Expected behavior

The method should be trimmed from the interface definition like the methods from AdditionalDataHolder (GetAdditionalData, GetAdditionalData) and Parsable (Serialize, GetFieldDeserializers) are.

The solution should be implemented in the same way it is for those other methods.

### How to reproduce

1. generate a go SDK with the backing store enabled
2. observe your model interfaces have the GetBackingStore method defined.

### Open API description file

_No response_

### Kiota Version

latest from main

### Latest Kiota version known to work for scenario above?(Not required)

_No response_

### Known Workarounds

_No response_

### Configuration

_No response_

### Debug output

Click to expand log
```

```

### Other information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.