Skip to content

fix #1980 GetAsync fails when specifying a null index. #2030

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

Merged
merged 1 commit into from
Apr 12, 2016

Conversation

Mpdreamz
Copy link
Member

var response = await elasticClient.GetAsync<T>(id, s =>
  s.Index(null));

Would not default index back to inferred type of T.

This PR makes specifying null for required route values a noop

For optional routevalues null still clears the routevalue so the
following still works

c => c.Index(project, i => i.Id(null))

will reset the id on and send the index request to
/inferredindex/inferredtype

```csharp
var response = await elasticClient.GetAsync<T>(id, s =>
  s.Index(null));
```

Would not default index back to inferred type of T.

This PR makes specifying null for required route values a noop

For optional routevalues null still clears the routevalue so the
following still works

```csharp
c => c.Index(project, i => i.Id(null))
```

will reset the id on and send the index request to
`/inferredindex/inferredtype`
@gmarz
Copy link
Contributor

gmarz commented Apr 12, 2016

LGTM

@gmarz gmarz merged commit c1bf703 into 2.x Apr 12, 2016
@gmarz gmarz deleted the fix/resettable-required-routevalues branch April 12, 2016 17:29
gmarz added a commit that referenced this pull request Apr 12, 2016
The test was still relying on .Index(null) causing the index to be null.
Mpdreamz pushed a commit that referenced this pull request Apr 12, 2016
The test was still relying on .Index(null) causing the index to be null.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants