Model General Information

This section contains the Fabric model general information. Model general information will be defined as a JSON object with the following structure:


curl --location 'https://[your_organization].datome.io/api/models/fabric/' \
--header 'Authorization: Bearer 74a6c88d-62fe-4c13-8b40-c21fabbae819' \
--header 'Content-Type: application/json' \
--data '
{
    "$id": "https://mangrovia.solutions/generic.json",
    "$schema": "https://json-schema.org/draft-07/schema",
    "title": "fabric",
    "description": "Fabric Model describes a fabric lot",
    "type": "object",
    "properties": {
        "unique_name": {
            "type": "string"
        },
        "id_technician": {
            "type": "number"
        },
        "id_employee": {
            "type": "number"
        },
        "available": {
            "type": "boolean"
        },
        "notes": {
            "type": "string"
        }
    },
    "required": [
    	"unique_name",
    	"id_technician",
    ],
    "additionalProperties": false,
    ...
}

Note: The model name is set by the URL https://[your_organization].datome.io/api/models/fabric, not by the “title” field.

Fields
Data Type
Description

$id

String

A fixed value required by JSON schema.

$schema

String

A fixed value required by JSON schema.

title

String

An optional field that defines the model’s name used in the UI.

description

String

An optional field that describes the model and is shown in the UI.

type

String

A field that defines the Model type for backward compatibility. It must be equal to object.

properties

Object

A list of the model’s characteristics.

required

Array

An optional field that defines the mandatory properties at the creation of the model.

search

Array

An optional field that defines the properties that can be used as search filters and will be listed in a column of the asset list.

creation

Array

An optional field that defines the properties that will be asked at the moment of the asset’s creation.

ui order

Array

An optional field that defines the order that is used to display the asset’s properties.

authorized_groups

Array

An optional field that sets the privileges needed to create the Asset, update the Asset, change the Asset’s state.

enum

Array

An optional field that defines an array of values that a property can take on.

states

Object

A field that defines the entry point of the Finite State Machine and every other possible state.

transitions

Object

A field used to compose the transition map and define every other state besides the default_state

mutations

Object

A field that defines a set of operations that modify the Asset’s Properties or State or log a new Event.

additionalProperties

Boolean

A field that defines the JSON-schema keyword used to enhance the model with additional characteristics only during its creation. There are three possible values: 1. true - new properties can be declared directly in the API request without any kind of validation because they are defined “on-the-fly”. 2. Object - the additional properties are defined inside a JSON Object written using JSON-schema keywords. Hence, each new attribute can be optional or “required” (since the “object” is defined within a "properties" block). 3. false - Default, no additional properties have to be evaluated during the creation of the model.

Last updated