Documentation
Feedback
Guides
API Reference

Guides
Master DataGetting started
Starting to work on Master Data v2 with JSON Schemas

Learn more about how to set up your JSON schemas

A JSON Schema defines how your data will be validated. Further information can be found in External documentation on JSON Schemas, this article on Understanding JSON Schema, and our article about the Master Data schema lifecycle.

Use the following API requests to manage your Master Data schemas:

Below you can learn more about how to set up your JSON schemas, and some Master Data features you can use with them.

Configuring a JSON Schema

A JSON Schema is composed of three main fields:

  • Properties: fields with their respective types.
  • Required: mandatory fields.
  • Title: Schema name.

Example:


_10
{
_10
"title": "Basic information of SKU",
_10
"properties": {
_10
"name": { "type": "string" }
_10
},
_10
"required": ["name"]
_10
}

The schema above defines the basic format of an SKU. In this case, only the name property. We also define this field as mandatory by adding the field name into the required array.

This JSON Schema validates the following JSON:


_10
{
_10
"name": "T-shirt"
_10
}

You can add these examples to JSON Schema Validator. If you change the JSON example in the validator to an integer, you will receive an error message, like in the example below.

  • Changing the name to an integer:


    _10
    {
    _10
    "name": 1
    _10
    }

  • Error message:


    _10
    Invalid type. Expected String but got Integer.

The JSON Schema validates only the fields configured in properties. The exceeding fields will be maintained without validation. To preserve only the fields configured in the JSON schema, see the additionalProperties property information in external documentation about JSON schema.

Master Data v2 data entities can have up to 60 schemas per entity.

Indexing fields

Use the property v-indexed to set up indexed fields. You must add the field to the properties to generate the indexer configuration with the right type.


_10
{
_10
"properties": {
_10
"field1": { "type": "string" },
_10
"field2": { "type": "integer" }
_10
},
_10
"v-indexed": ["field1", "field2"]
_10
}

Default fields

Use the property v-default-fields to configure which fields will return without indication in the fields query string.


_10
{
_10
"v-default-fields": ["field1", "field2"]
_10
}

Inheritance of schemas

Use the property v-canonicalto to set up another JSON Schema in the same data entity to inheritance.


_10
{
_10
"v-canonicalto": "https://{host}/api/dataentities/{data-entity-name}/schemas/{my-base-schema}"
_10
}

Enabling public fields

Use the property v-security to set up which fields are public (request without user authentication).


_10
{
_10
"v-security": {
_10
"allowGetAll": false,
_10
"publicRead": ["field1"],
_10
"publicWrite": ["field1"],
_10
"publicFilter": ["field1"]
_10
}
_10
}

Disabling default caching

Use the property v-cache to disable default caching.


_10
{
_10
"v-cache": false
_10
}

Creating triggers

Use the property v-triggers to set up automatic actions that will be performed by the platform if the creation or update of a document meets certain criteria defined by you. Learn more in Setting up triggers in Master Data v2.

Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
+ 3 contributors
Was this helpful?
Yes
No
Suggest edits (Github)
Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
+ 3 contributors
On this page