Skip to content

Best practices to use JSON value #517

@WeihanLi

Description

@WeihanLi

We're integrating the LaunchDarkly based on OpenFeature SDK, it did not goes well when we tried to integrate JSON values from LaunchDarkly, are there some best practices about using JSON values?

With my limited research, we should use the GetObject API for getting JSON values, while the value we got is a Structure object, how should we convert it strong typed object performantly?

var result = await _featureClient.GetObjectDetailsAsync(
            flagKey, default, evaluationContext, cancellationToken: cancellationToken);
var obj = result.Value.AsObject;

There's a ToJsonString() method for the LDValue, and implemented a customized JsonConverter for the LdValue in the LaunchDarkly SDK, maybe something similar would be needed for the Value in the open feature SDK also?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions