Context properties types
vrshgv opened this issue · 3 comments
Describe the feature request
It's not good that it's impossible to update unleash custom context fields with anything except string. Not even a number. Why would I need all these operators for constraints, when there is no chance to use them with my context fields.
Background
No response
Solution suggestions
No response
Hi, @vrshgv!
Good question. Unleash only accepts strings for context values, but it will try to convert the string to the appropriate value when checking a flag's constraints, so if you use a numeric greater than operator for the value "5"
, it will convert that value to the number 5 before doing the conversion check. If the value can't be converted, the constraint will fail.
Does that answer your question?
Hello! Yes, it does, thank you. I guess it was not obvious for me in documentation.
Great! And that's great feedback about the documentation. I'll see if we can't update that 😄
It seems your issue has been resolved, so I'll go ahead and close the issue now. Feel free to open it again if you feel there's more to be done.