flagsmith
flagsmith copied to clipboard
Support for JSON traits + remote config
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.
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.
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.
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.
JavaScript supports this now, I think #1441 and #3457 would be a step towards support for typed languages.
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?
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
Closing this in favour of #3457