open-feature / ofep

A focal point for OpenFeature research, proposals and requests for comments
https://openfeature.dev
20 stars 15 forks source link

Long value support in MutableContext #39

Closed pbhandari9541 closed 1 year ago

pbhandari9541 commented 1 year ago

Issue: MutableContext doesn't allow us to add Long value. i.e public MutableContext add(String key, Long value)

wondering if there is a plan to support long value?

Our use case: Customer provides userId of long value type and we are adding in a context as String. Eventually, we need to convert to long value later. if MutableContext supports long value, we may mandate customer to enter long value directly.

toddbaert commented 1 year ago

MutableContext is just one implementation of EvaluationContext, which extends Structure. I think you should be able to extend it or implement your own that includes Long.

However, I think we could support Long in MutableContext while maintaining backwards compatibility by since all values in the context are stored as plain objects.

justinabrahms commented 1 year ago

Agree with Todd. Do you want to file a pull request for this, @pbhandari9541 ?

beeme1mr commented 1 year ago

Closing this issue since it's a implementation detail of the Java SDK.