Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot apply indexing with [] #6053

Open
TomaszGrzmilas opened this issue Jan 23, 2025 · 2 comments
Open

Cannot apply indexing with [] #6053

TomaszGrzmilas opened this issue Jan 23, 2025 · 2 comments
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

Comments

@TomaszGrzmilas
Copy link

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 ```
</details>


### Other information

_No response_
@TomaszGrzmilas TomaszGrzmilas added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Jan 23, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage 🔍 in Kiota Jan 23, 2025
@msgraph-bot msgraph-bot bot added the Csharp Pull requests that update .net code label Jan 23, 2025
@baywet
Copy link
Member

baywet commented Jan 23, 2025

Hi @TomaszGrzmilas
Thank you for using kiota and for reaching out.

Can you please share the OpenAPI description you're using to generate the client?

@baywet baywet added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:question An issue that's a question and removed type:bug A broken experience status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Jan 23, 2025
@baywet baywet moved this from Needs Triage 🔍 to Waits for author 🔁 in Kiota Jan 23, 2025
Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
Status: Waits for author 🔁
Development

No branches or pull requests

2 participants