Storing user created dry-schema in a database

I’m working on a web application that let’s the user define input / output data structures through an user interface.

Now I’m wondering if I could leverage dry-schema in the background and build
“anonymous” schema definitions “on the fly” instead of rolling my own solution.

In order for this to work, I have to serialize the values from the UI for storage in a database and deserialize it into a dry-schema instance. Would it be a good idea to use the AST for this or is the AST considered “private API”?

Thanks for any insights :slight_smile:

The AST is public API but I will warn you that it’s complicated to work with, and not documented very much.

This approach would work, although I would also recommend considering JSON Schema as an alternate possibilty, if for no other reason than portability.