open-feature / spec

OpenFeature specification
https://openfeature.dev
Apache License 2.0
666 stars 35 forks source link

Float/Integer evaluation in typed langages #115

Closed thomaspoignant closed 2 years ago

thomaspoignant commented 2 years ago

I was looking at the different SDKs and we don't have a feature parity concerning the number flag evaluation.

Sometimes the number method retrieves integer (java SDK) and others are retrieving float. It could be great to be explicit in the spec about what behavior we expect.

Reference in the specs

toddbaert commented 2 years ago

I'm hesitant to define exactly what types/bit-lengths/signs we expect, because there's so much variety across languages. I think it's best for the spec to stay vague here. What we do have is this: https://github.com/open-feature/spec/blob/main/specification/types.md#number, which we could perhaps link/reference better throughout the spec.

A numeric value of unspecified type or size. Implementation languages may further differentiate between integers, floating point numbers, and other specific numeric types and provide functionality as idioms dictate.

I'm open to other opinions though.

thomaspoignant commented 2 years ago

What is not clear from me is if we want to have one getNumber function that is generic or do we also accept to have multiple functions such as getInteger, getFloat, getFloat64 etc ...

thomaspoignant commented 2 years ago

Resolves in #116