Import/export JSON schema for models

I noticed that dato uses a json-schema definition for validating the structure of your own API.
I also love the ERD export of the content model.
I think a valuable feature would be to expose a json-schema definition for our sites’ data models.

reasoning: we’re investigating better ways to enforce data integrity within our sites. to do this we intend to define our content models with json-schema so that we can validate the data is being returned in the proper shape. we also intend to implement a way of syncing changes to the schema back up to Dato so that our engineers can maintain the content model in code (not just through the GUI).

it seems like you’re already keen on json-schema and it’s benefits, it would be great if that could trickle down to our sites’ content models as well


Originally posted by kyle.macdonald@vice.com

We are going to implement an import/export functionality for the model schema

Any news on this? :slight_smile:

Ping! This would be a very welcome feature indeed.

hello @colin welcome :slight_smile:

We want to implement this feature request but it’s not going to happen in this iteration. This is what we have planned: https://www.datocms.com/blog/what-happened-in-last-three-months#future-plans

But in the next iterations we are going to implement this or something equivalent as a backup/restore feature as per https://www.datocms.com/blog/what-happened-in-last-three-months#upcoming-big-features

So expect that probably within the next six months, sorry but I cannot be more accurate.

2 Likes

Appreciate the response @matjack1 and outline timeline is fine :slight_smile:. Thanks for the warm welcome.

1 Like

My use case is for using gatsby themes. I want to be able to auto populate datocms models to match my themes so I can get up and running quickly. Looking forward to this

1 Like

Also need something like this for a kit we’re working on

This sounds awesome. I’m excited to use DatoCMS as the Headless CMS solution for a variety of projects and it would make things so easy if we could clone (or export and reimport) the content models we have established to set up new projects.

1 Like

+1.
Would love the feature. Sometimes I need to change the schema dramatically. I’m a bit afraid doing so without knowing if I mess up I can revert back easily.

1 Like

This feature would be great and extremely beneficial for Language Servers and text editors. Considering Schemas have been widely adopted in text editors if Dato was to provide a schema export of projects I could leverage them with an LSP implementation and provide intellisense features like completions, diagnostics and hovers in text editors that support the protocol.

Please make this happen

1 Like

Is it possible to download the ERD in some dataform other than PDF? It would be great if I could edit the file for my own documentation.

no sorry @todd.brannam but I’ve noted that down. Makes sense to be able to download it in another format.

I’ve noted that down, we’ll get back here when we ship something!