open-feature / spec

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

Have different methods for float and int #116

Closed thomaspoignant closed 2 years ago

thomaspoignant commented 2 years ago

See https://github.com/open-feature/spec/issues/115 for the context. Discussion also on slack.

toddbaert commented 2 years ago

@justinabrahms @agentgonzo @InTheCloudDan pinging you all on this one, since it's relevant to Java, and also the Cloudbees SDK differentiates between floats/ints, while the LD SDK uses an abstraction that can be interpreted as either. Justin suggested we use something more generic, like Number, which I'm also OK with, but I think in that case we still might want to add something to the spec as @thomaspoignant suggests to make sure we have some way of support both floating point and integer values.

I think personally, I would prefer to just provide separate methods as @thomaspoignant has suggested here, but I'm interested in other takes... It does feel very "go-lang-y" which is why I think it was implemented this way in go-feature-flag.

justinabrahms commented 2 years ago

I'm not opposed to separating floats vs ints. I'd just like to avoid it if we could. But I'm hearing that maybe we can't? So... let's not. :)

benjiro commented 2 years ago

This sounds fine to me, do we need to be more explicit about types so it's not left up to interpretation? Eg float vs float64(double) vs float128(decimal) int32 vs int64(long)

Thoughts? @toddbaert @thomaspoignant

thomaspoignant commented 2 years ago

float vs float64(double) vs float128(decimal) int32 vs int64(long)

It is a bit too detailed from my point of view. Typescript does not have a diff between int and float, in java float is not standard but they are using double, etc … I would avoid being precise here.

toddbaert commented 2 years ago

It is a bit too detailed from my point of view. Typescript does not have a diff between int and float, in java flot is not standard but they are using double, etc … I would avoid being precise here.|

Agreed. We also mention this, in the types.md doc:

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.

https://github.com/open-feature/spec/blob/main/specification/types.md#number

@thomaspoignant we might want to link to this after the normative spec text, maybe below your example.

thomaspoignant commented 2 years ago

BTW the ci is failing on this link https://www.w3.org/TR/qaframe-spec/ that is working fine from where am I.

toddbaert commented 2 years ago

BTW the ci is failing on this link https://www.w3.org/TR/qaframe-spec/ that is working fine from where am I.

Re-ran it, seems to work now. Probably the site was slow for a time.

toddbaert commented 2 years ago

Anyone want to add a final approval for this? Seems like we have consensus.