Import (JSON Schema)
Step By Step Guide
Expand the features tray, then from channels, click on 'Import JSON-Schema' to open the Import UI.

From the Import UI, you can create a new space (see Spaces) or choose an existing space to import to, In this tutorial we will create a new space 'Sample Space'.

Select the newly created space to show the 'Data Sources' UI.

From this UI you can add and control the data sources that will be connected to the selected space.
You can click on "Add Data source" (1) to add a source by URL, upload a file (.json), or even connect your account to github and fetch the file from there. We will use a simple example, you can use this url.
Alternatively you can use the Crawl URL feature (2) where you can provide a url.
CoreModels will scan for all JSON links and automatically add it to the list.
You can also provide a github folder url in the Crawl URL feature (2) and it will automatically add the files in that directory
(Optional) You can click on 'Advanced Settings' to view the import profile settings (more information at JSON-Schema profile).
Once the schema files are added click on 'Scan Files' (4), this will start a two phases scans
First, it will scan for used references that are included in
$refand automatically add them in the list. If any new reference is added you will get a prompt in order to continue or review the list.Second, CoreModels will scan the files and detect all the JSON Schema (and non-JSON Schema) keywords that have been used in your schema.
CoreModels will then show a preview of all the import that will happen to the space.
In our tutorial we are starting from a freshly created space, therefor all the schema nodes are new to the space.

By clicking the Import button, CoreModels will validate and show any necessary notification, then prompt the user in order to continue, and show the tasks UI where it will start the import process.
Once it's done, CoreModels will automatically refresh the page.
We can now navigate to the Types Grid tab and see the schema. The sample we used should show the following.


Next, let's configure the grid to show the mixins and the rules that were added along with the schema.

Open the 'configuration' side panel (1), and configure the grid to show 'JSON Schema Rules' and the 'JSON Schema Mixin', add this to both 'Type Columns' (2) and 'Element Columns' (3), you can then explore the added elements by expanding 'Elements' (4), and find the metadata or the validation rules for your schema at the 'JSON Schema Rules' mixin (5).
CoreModels has a special UI for 'Combination' and 'Conditional' keywords, such as anyOf, allOf, oneOf, not, if, else, then. All of them can be managed using the 'JSON Schema Rules' mixin, it provides a powerful UI - the 'Rule Builder' - where you can view and edit the rules.

Now that you have imported your schema, let's see how to export it or synchronize it from github using the merge feature, or push the changes from CoreModels to the github repository Push To Github (JSON Schema).
Note: If you have created the project using the 'JSON Schema Template', some terminology items from this tutorial will be slightly different to better align with the JSON Schema community:
'Types Grid' would be named 'Objects Grid'
'Elements' would be named 'Properties'
You can always switch the template from the 'Project Admin' -> 'Settings' at the 'Maintenance' tab
JSON-Schema profile
The profile shows some commonly used JSON Schema keywords, and also the keywords that are used in your schema, $id, $anchor, $ref etc..
Some keys will have some disabled fields because they have some special handling in CoreModels to align with how they are used. You will find below a table for each option:
Key
The name of each JSON key that was found in the JSON Schema sources.
it may be followed by a hint, if the key was a special JSON Schema key.
Transformed to
This field controls the options found in 'transformation value'. In simple terms, when a field is storing regular text values, we choose 'mixin' or 'new mixin'. an example from the sample file would be the '$id' property.
But if the value is actually referring to another node in the graph, then we should set it as 'Relation' (ex: 'properties' key).
None -> do not import.
Mixin -> the values will be stored as text, allows choosing mixins under 'transformation value' column.
New Mixin -> the values will be stored as text, allows entering the new mixin name.
Relation -> the values will point to other nodes, allows choosing relations under 'transformation value' column (if the importer finds a relation to a non-existing node, it will automatically create it).
Relation -> the values will point to other nodes, allows entering the new relation name
Export Format
CoreModels will identify each property's type according to the JSON Schema values that were found for this property. changing this has no impact during the import but it's stored to preserve how each property should look like in the export.
"key": null -> Null
"key": true -> Boolean
"key": 12 -> number
"key": "myValue" -> String
"key" : {"innerKey":"innerValue"} -> Object
"key": ['val1', 'val2'] -> Array
CoreModels treats object schemas as types, while all other schemas are considered elements. A schema is identified as a type if either:
The value of the
typekeyword is set to"object", orThe schema defines a
propertieskeyword.
Last updated