Java client SDK - Evaluate boolean flag using object with list #5051
Replies: 0 comments 2 replies
-
|
The Java Flipt client SDK expects the context for flag evaluation to be a Map<String, String>, so it doesn't directly support passing a list (like roles) as a value. A common workaround is to encode your list as a single string—typically a comma-separated list, for example: context.put("roles", "admin,user,editor"). You can then write your flag targeting rules to parse or match against this string as needed. There isn't built-in support for lists or arrays in the context object in the current SDK or its documentation, and this approach is reflected in the official usage examples as well cite. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
It’s the Flipt API. The context is defined as a |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, Im looking to build a boolean flag evaluation using
fliptClient.evaluateBooleanbut the context object is a Map<String, String>. How can I pass a list, for instance roles, where I would send a list of string containing all user roles to help with the evaluation?Thanks
Beta Was this translation helpful? Give feedback.
All reactions