schema.ospp

Schema property file

type

object

properties

  • computedFields

Define automatically generated fields that are computed at each creation and update of an entry of this collection. These are defined by a map where:

  • key: name of the generated field

  • value: computed field definition that determines how the field is generated

There are multiple type of computed fields. Theses types determine the operation that will be effected.

Currently, these types are available:

  • CONCAT: Concatenate the values of the properties into a new property. The result is defined by a format that must be given. Always result in a new string property.

  • COALESCE: Take the given properties and retrieve the first one that is not null. The order of properties is kept and defines the order the values are tested.

  • MERGE_ARRAY: Take two or more arrays and attempt to merge them together into a new array.

  • SPLIT: Take a string property and separate it into an array by using a given regular expression. The result is either the array containing every element or only the one defined by the given position.

The result of the computed field is stored within every collection entry. Theses fields can then be accessed like any normal field in a view or a form for example.

To learn more about computedFields, look into the collection feature documentation ↗️.

type

object

additionalProperties

oneOf

CONCAT

COALESCE

MERGE_ARRAY

SPLIT

  • filters

The views that defines column that can show one of the schema properties

type

array

items

SchemaFilter

  • isTemplateGeneratedByOspComposer

Name of the playbook that generated this file. If present, the file is managed by the Composer and may be overwritten on regeneration. Used for selective clean. Do not edit or set manually.

type

string

  • schema

The schema definition

  • templateId

The id of the template to use for this file

type

string

  • templateVariables

The variables and their values to be replaced from the template

type

object

additionalProperties

  • type

Is this schema meant to represent one of the predefined collection of the module ?

Look at the collection module documentation to find more information on these predefined collections ↗️.

type

string

enum

USERS_PREFERENCES, USERS_RIGHTS, PROFILES_RIGHTS, SERVICES, AUDIT

  • uniqueFields

The list of properties keys that represent unique ids across the entries of this collection.

As an example, for an array (named journal) of objects with a property id defined inside this list (as journal.id), every object of this journal array must have an unique id value.

To enforce this uniqueness, an unique index is expected to be present in the index configuration of the collection ↗️.

type

array

items

type

string

  • variablesFiles

The variables files to use to replace the variables. The first file of the list will take precedence over the following one. Template variables take precedence over the contents of the files.

type

array

items

type

string

additionalProperties

False

CONCAT

type

object

properties

  • type

type

string

enum

CONCAT

default

CONCAT

  • format

Describe the result of the concatenation of the schema properties.

The format allow the use of placeholders that will be replaced with the value of the property described by the placeholder. These must start by ${{ and end by }}.

As an example, if you want to combine a property firstname and a property name to create a full name field, you can define the format as the following:

"${{name}}, ${{firstname}}"

Like every other computed fields, the properties can be referenced by giving a valid JsonPath expression.

As examples:

"${{name}}, ${{firstname}}"
"${{$.name}}, ${{$.firstname}}"
"${{person.name}}, ${{person.firstname}}"

In addition to specify directly the property, you can define a list of mappings and use the mapping name instead (look into mappings parameter).

type

string

  • mappings

List of mappings that can be used inside the format. A mapping allow to map a string key with a schema property path. This can be useful if you have complex path to help clarify what a property represent and it can also make the format more readable and easy to understand.

The name of the mapping is the one you need to use in the format:

"mappings": [
 {"name": "add", "field": "address"},
 {"name": "web", "field": "website"}
],
"format": "Address: ${{add}}, Website: ${{web}}"

This option is fully optional.

type

array

items

ConcatFieldMapping

additionalProperties

False

ConcatFieldMapping

type

object

properties

  • field

Value linked to this mapping. Use a JsonPath expression to access the wanted schema property.

type

string

  • name

Name of the mapping. Use this inside the format.

type

string

additionalProperties

False

COALESCE

type

object

properties

  • type

type

string

enum

COALESCE

default

COALESCE

  • fields

List of fields to test if they are present or not. Like every other computed fields, the properties can be referenced by giving a valid JsonPath expression.

The result of the computed field will be the first element on this list of fields that is not null, meaning that the order of the fields is important.

type

array

items

type

string

additionalProperties

False

MERGE_ARRAY

type

object

properties

  • type

type

string

enum

MERGE_ARRAY

default

MERGE_ARRAY

  • fields

The list of array type properties to merge together. Like every other computed fields, the properties can be referenced by giving a valid JsonPath expression.

The result of this computed fields will always be a new array that combines every entry of the referenced fields.

type

array

items

type

string

additionalProperties

False

SPLIT

type

object

properties

  • type

type

string

enum

SPLIT

default

SPLIT

  • field

Property to split the content from. Must be a string property. Like every other computed fields, the property can be referenced by giving a valid JsonPath expression.

The result of the computed field will be an array containing every part of the field.

type

string

  • position

If a position is defined, the result of the computed field will contain only the element at the given position, instead of the full array.

type

integer

  • regex

A valid delimiting regular expression. This is used to determine how to split the field.

type

string

additionalProperties

False

SchemaFilter

type

object

properties

  • id

A reference to this collection filter.

type

string

  • name

Name of this collection filter.

type

string

additionalProperties

False