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

2 Likes

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.

2 Likes

+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!

Looking forward for this feature, in my case I would like to enable autocompletion of graphql queries as described here Configure graphql syntax highlighting in VS Code - Today I Learned

Hi @mat_jack1 . Any news on this feature, we would need it as well. More and more projects migrating to DatoCMS and this would be useful to move certain common models from project to project.

3yrs later, whats the state of this issue? Still ongoing or abandoned?

We are working to make this happen in these weeks, stay tuned as we are going to release something foundational for this very soon :slight_smile:

2 Likes

Any news on this?

We would like to automatically generate TypeScript type definitions for our models, and this seem like it would make that possible.

sorry @ops, I’ve missed your comment on this, but isn’t what you need already possible: How To Generate TypeScript Types From GraphQL - DatoCMS ?

Otherwise, can you please provide a bit more info on your use case for this? Thanks!

I would love to copy models between projects.
Any progress on this?

Clone a project is great, but is limited in usage.