Anyone done any JSON schema validation in CFML?
# cfml-general
a
Anyone done any JSON schema validation in CFML?
Found a few on the Google but not sure if they are maintained so if people have recommendations that would be handy. Thanks.
g
Schema validation? As in parsing a schema and applying validations, or setting up a structure you want to export consistently as json ?
a
I have a JSON schema definition. I want to validate that a JSON string complies with the schema. Something like this (but done with CF) https://www.jsonschemavalidator.net/
r
I've done a fair amount of it but not with CF. We use Justify (https://github.com/leadpony/justify) primarily from the command-line or embedded in automation scripts. Not sure if the underlying classes there are exposed in a way you could use them within CF logic, but you could conceivably do it via cfexecute if not?
a
Thanks - will have have to try out some of the java solutions when I get time. It's a nice to have not a must have as the configurations stored as JSON won't change often but would be nice to validate them.