flagsmith icon indicating copy to clipboard operation
flagsmith copied to clipboard

Feature values -- schema and validations

Open Jaribeau opened this issue 2 years ago • 5 comments

When updating feature Values (remote config), it would be excellent to have a way to specify the allowable range of these values and validate the value input against that schema.

Jaribeau avatar Sep 09 '22 12:09 Jaribeau

Would this just be for numeric values? Did you have a validation schema in mind?

dabeeeenster avatar Sep 12 '22 14:09 dabeeeenster

Ideally it would be flexible. At least supporting different primitive types, maybe something like: integer, float, string, boolean.

Our current in-house config management utility uses a JSON schema -- so it can allow anything from primitive data types (with a specified range of valid values) to full json documents (with a specified document structure).

Something like JSON-Schema could do the trick. Perhaps the easiest way to implement this in the Flagsmith UI would be to add an optional "JSON Validation Schema" field alongside the value field, where the schema can just be pasted in.

Where a more involved way would be to build a UI that can generate the Schema.

Jaribeau avatar Sep 12 '22 14:09 Jaribeau

So you would want to be able to validate primitive types as well as JSON documents?

dabeeeenster avatar Sep 12 '22 15:09 dabeeeenster

That would be ideal, yup.

Jaribeau avatar Sep 12 '22 15:09 Jaribeau

But even just primitive types would be a great start.

Jaribeau avatar Sep 12 '22 15:09 Jaribeau

Closing in favour of https://github.com/Flagsmith/flagsmith/issues/3457

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