Decoder for JSON Fields

Hey there!

Not sure how niche that proposal is, but this feature would be really useful for our team in a lot of scenarios.

Adding a binding schema / validation / decoder functionality to the JSON fields would allow editors to get a better understanding of what is supported for this specific field. The field would be validated on input and only saved if it passes, otherwise show specific errors on what does not work.

If it would somehow be possible to define an interface that the input is valid, this would make it very useful to pass props to components, or data needed to plot a chart with a lot less safeguards in between. Especially if the interface is also exposed in the API. We work around this by creating specific pages with an input validator, which needs copy/paste/trial/error to ensure the input gives the correct output in the build.

I would be interested to hear if this is of interest or rather should be a plugin as it might get quite specific.

Thanks!

TL;DR: Something like io-ts for JSON-fields -> :heart:

hey @gerhard what about a custom validator that you could implement on your end and that we could interrogate as an API call?

Something like this: Custom validation ?