Cannot apply indexing with [] #6053
Labels
Csharp
Pull requests that update .net code
Status: No Recent Activity
status:waiting-for-author-feedback
Issue that we've responded but needs author feedback to close
type:question
An issue that's a question
What are you generating using Kiota, clients or plugins?
API Client/SDK
In what context or format are you using Kiota?
Windows executable
Client library/SDK language
Csharp
Describe the bug
I'm trying to get data as described in the documentation, using []:
https://learn.microsoft.com/en-us/openapi/kiota/request-builders
I' using .NET 9 and client was generated using Kiota 1.22.3:
I get error: Cannot apply indexing with [] to an expression of type 'UsersRequestBuilder'
Expected behavior
I think that this should work as described in documentation.
How to reproduce
var tokenProvider = new IFSAccessTokenProvider();
var authProvider = new BaseBearerTokenAuthenticationProvider(tokenProvider);
var pnfr = new ParseNodeFactoryRegistry();
var json = new JsonParseNodeFactory();
pnfr.ContentTypeAssociatedFactories.TryAdd(json.ValidContentType, json);
var adapter = new HttpClientRequestAdapter(authProvider, pnfr);
var client = new UserHandlingClient(adapter);
var user = await client.Users["user1"].GetAsync();
Open API description file
No response
Kiota Version
1.22.3
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
```The text was updated successfully, but these errors were encountered: