This should be a feature request rather than a bug, but the feature request form doesn't seem to fit, in my opinion.
I'm migrating Okta.SDK from v5.4.1 to v7.0.6. Previously, after receiving the Hook Event I used this code to deserialize it into ILogEvent objects:
private IEnumerable<ILogEvent> DeserializeEvents(JArray events)
{
var data = new DefaultSerializer().DeserializeArray(events.ToString());
var factory = new ResourceFactory(_oktaClient, _logger);
return data.Select(e => factory.CreateNew<LogEvent>(e));
}
Describe the bug?
This should be a feature request rather than a bug, but the feature request form doesn't seem to fit, in my opinion. I'm migrating Okta.SDK from v5.4.1 to v7.0.6. Previously, after receiving the Hook Event I used this code to deserialize it into
ILogEvent
objects:Unfortunately, since v6 it's not possible anymore. Looking into the source code, I found that the serializer is now configured on the
RestSharp
client and it's not accessible from the outside https://github.com/okta/okta-sdk-dotnet/blob/b95064cd549113880db10c8629be822628e0c7ea/src/Okta.Sdk/Client/ApiClient.cs#L497I'd like to request making the serializer public and not coupled to the RestSharp.
What is expected to happen?
I should be able to deserialize the Okta hook events into
Okta.Sdk.Model.LogEvent
using the SDK's serializer.What is the actual behavior?
The serializer is internal and not accessible from the user code.
Reproduction Steps?
Subscribe to event hook. Deserialize the received json into the following (simplified) structure
Try deserializing the
EventPayload.Data.Events
toIEnumerable<Okta.Sdk.Model.LogEvent>
Additional Information?
No response
.NET Version
8.0.204
SDK Version
7.0.6
OS version
No response