You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deserialization Cannot Handle Types which Implement IDisposable (JsonDocument)
ObjectDisposedException: Cannot access a disposed object.
Object name: 'JsonDocument'.
How can one reproduce the bug?
using System.Text.Json.Nodes
var response = await openSearchClient.SearchAsync<JsonDocument>(searchRequest);
return response.Hits.Select(hit => hit.Source.Id).ToList(); //Use the disposable object
What is the expected behavior?
I expect to be able to deserialize to standard .NET Json abstractions.
I expect to be able to deserialize to disposable values.
What is your host/environment?
MacOS 13.6.7 (22G720)
Do you have any screenshots?
No
Do you have any additional context?
I am attempting to deserialize a request to an index alias that contains multiple types. Since the Search interface does not support this, I need to deserialize the response to a more generic type. Ideally one of the standard and existing Json abstractions.
The text was updated successfully, but these errors were encountered:
What is the bug?
Deserialization Cannot Handle Types which Implement IDisposable (JsonDocument)
How can one reproduce the bug?
What is the expected behavior?
I expect to be able to deserialize to standard .NET Json abstractions.
I expect to be able to deserialize to disposable values.
What is your host/environment?
MacOS 13.6.7 (22G720)
Do you have any screenshots?
No
Do you have any additional context?
I am attempting to deserialize a request to an index alias that contains multiple types. Since the Search interface does not support this, I need to deserialize the response to a more generic type. Ideally one of the standard and existing Json abstractions.
The text was updated successfully, but these errors were encountered: