Export (JSON Schema)
In this guide you will see how to create a JSON-Schema profile manually, or simply just how to export your imported schema.
If you are following the tutorial from Dynamic (JSON Schema) you can skip to Step 2: Use the profile to export your schema
Before starting, let's assume that you have already created some nodes, and you already added some mixins and relations, we will assume that you have used a mixin to store a title, and a summary for your nodes.
Step 1: Create the import/export profile
From the features tray, click on 'Grids' โ click on the plus icon.
Select 'JSON-Schema Import/Export Profile' as the Grid Type, and add an appropriate name. The profile UI will automatically open up.
On the bottom left corner, Click on 'Continue without Source'
On the bottom left corner, Click on 'Add Key', and check the 'Is Special Key' checkbox.
select 'title' from the dropdown
Some fields will be auto filled and disabled, since this is a 'Special Key' (Special Keys have pre-configured 'Key Scope', and 'Export Format')
The 'title' card will show up, with the 'Transformed To' set to Mixin.
Set 'Transformation Value' to the mixin that has the value of the title.
Click 'Save'
Repeat the process to add another key for the assumed 'Summary' field, but this time let's not check the 'Is Special Key' checkbox
Set the 'Key Scope' to 'Types Or Elements'
Set the 'Transformed To' to 'Mixin'
Set 'Transformation Value' to the mixin that has the value of the summary.
Set 'Export Format' to 'String'
Repeat the process for any other mixins or relations that you are using in your model
(Suggestion) Add the 'properties' relation, and configure the 'domain includes' as the transformation value.
Note that Relations are usually exported as 'Array' or 'Object' - this is set in the 'Export Format' field.
Now that the profile is set, let's see how to use it.
Step 2: Use the profile to export your schema
Navigate to the 'Types Grid', In the 'Types Grid' tab and on the far right, you'll find the sidebar tab, click on 'export', which will expand the export menu, then select 'JSON Schema'.
Alternatively you can open the dedicated export UI, Features Tray โ Channels โ Export โ JSON Schema
Select the profile you created (or that was created automatically during the import) at the 'Import Configuration' dropdown.
Select 'Types' at the 'Export Includes' dropdown.
Let's leave the other options for now, and click on 'Process', (see the hint below).
After the export is done, you can either download the file or click on 'Preview' to see the export results
Now that you have exported your schema using the default options, let's explore what the other options mean.
Export Options
Include All Relations:
By Default, CoreModels filters the export results based on the selected space, setting this option to true, will include the relations that exist in the current space, regardless if its target existed in the current space or not.
Selected Types:
This control specifies which type the exporter should start with.
Last updated