flagsmith icon indicating copy to clipboard operation
flagsmith copied to clipboard

Support for JSON traits + remote config

Open kyle-ssg opened this issue 3 years ago • 3 comments

We currently support setting numeric, string and boolean traits / remote config, people also ask for JSON support.

Slightly related to this, people also ask that if we do this we have some sort of TypeScript or schema validation.

Unfortunately, we'd need to roll this change out to SDKs.

kyle-ssg avatar Jul 14 '22 14:07 kyle-ssg

This is problematic for languages that don't have native JSON support. For example, in Java there are a variety of JSON SDKs without any one being a standard.

dabeeeenster avatar Jul 14 '22 15:07 dabeeeenster

I think the solution to this could be to add a separate field to signify it being json and SDKs can opt into parsing it.

kyle-ssg avatar Aug 11 '22 09:08 kyle-ssg

I think the solution to this could be to add a separate field to signify it being json and SDKs can opt into parsing it.

This still doesnt help with e.g. Java. Maybe the languages with native support could provide a native object for it, but for something like Java it's problematic.

dabeeeenster avatar Aug 13 '22 09:08 dabeeeenster

JavaScript supports this now, I think #1441 and #3457 would be a step towards support for typed languages.

kyle-ssg avatar Apr 26 '24 08:04 kyle-ssg

I might be wrong about Java?

Regardless, I think if we had our time again we would have completely untyped config values and just leave it up to the developer. If thats the case, adding more types would be going in the wrong direction?

dabeeeenster avatar Apr 26 '24 08:04 dabeeeenster

Quite a common ask (2 above related issues) is for people to be able to define a schema for values so that people don't add the wrong config for an environment.

This doesn't necessarily need to affect SDKs I guess, it's more just preventing people from entering incorrect remote config. Having said that, the suggestions in https://github.com/Flagsmith/flagsmith/issues/3457 could lead to generated typed definitions, at least in the JavaScript SDK

kyle-ssg avatar Apr 26 '24 08:04 kyle-ssg

Closing this in favour of #3457

dabeeeenster avatar Apr 26 '24 08:04 dabeeeenster