Skip to content

Cannot access response data on Indices.GetAlias API #7048

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

Closed
Alkaersig opened this issue Nov 25, 2022 · 3 comments · Fixed by #7066
Closed

Cannot access response data on Indices.GetAlias API #7048

Alkaersig opened this issue Nov 25, 2022 · 3 comments · Fixed by #7066
Labels
8.x Relates to a 8.x client version
Milestone

Comments

@Alkaersig
Copy link

Alkaersig commented Nov 25, 2022

Elastic.Clients.Elasticsearch version:
8.0.0-rc.2

Elasticsearch version:
8.x.x

.NET runtime version:
6.0

Operating system version:
Windows 11

Description of the problem including expected versus actual behavior:
According to the list of supported API's the Indices.GetAlias is supported in the current version. But no data is accessible in the response (AliasResponse), only whether the response is valid (IsValidResponse) along with Error, Warnings, DebugInformation and API Call Details.

As i read the specifications a dictionary should be available:
body: Dictionary<IndexName, IndexAliases>

Which matches the data returned from a direct HTTP request to the API endpoint.

If i look into the AliasResponse through debugging there is a non-accessible BackingDictionary that holds the values of the response, but as this is not accessible it is not of much help.

So for now this method is not of much use other than checking for existence, which already has its own API.

Steps to reproduce:

  1. Make a call to ES 8 using esClient.Indices.GetAliasAsync()
  2. Inspect the returned AliasResponse, it has no accessible Dictionary<IndexName, IndexAliases>

Expected behavior
Response should contain an accessible dictionary of IndexName, IndexAliases

@Alkaersig Alkaersig added the 8.x Relates to a 8.x client version label Nov 25, 2022
@stevejgordon stevejgordon added this to the 8.0.2 milestone Nov 28, 2022
@stevejgordon
Copy link
Contributor

Hi, @Alkaersig.

Thanks for raising this. Indeed, this looks like a bug in the code generator, which isn't emitting the public property to access the backing dictionary. This affects most types deriving from DictionaryResponse:

  • GetAliasResponse
  • GetFieldMappingResponse
  • GetIndexResponse
  • GetTemplateResponse

The solution is to emit the appropriate property during code-generation or to manually add the properties and accessor methods as we do for GetMappingResponse.

We'll aim to fix this for the next patch release.

@stevejgordon
Copy link
Contributor

@Alkaersig This has been addressed in 8.0.2, which we released today.

@Alkaersig
Copy link
Author

@stevejgordon thanks Steve! I updated our solution to use version 8.0.2 and can confirm that it works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.x Relates to a 8.x client version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants