Objects Definitions
Locale
key - Two-letter code of a language.
default - Defines if a locale is a default locale for a project.
active - Defines if a locale is active in a project.
Field
Field object has two possible forms, depending on if the field is a collection or not.
Non-collection field
key (string) - Field key specified in the spec file. Required.
values (object) - An object which maps two-letter codes of locales to values for these locales. Required, but can be empty object.
For localisable field, values
object with locale-value mapping:
For non-localisable field, unless it's empty, values
object has all
key as locale code:
If default value for a field is specified in the spec, it will be applied as a value for default locale (or for all
) when resource is created. Defaults are not applied on resource update. It is possible to overwrite default value. In order to discard default value, null
can be passed as a value.
The values of the field can be updated by sending request with new values. null
value can be sent to clear value for the locale.
It is not possible to update value only for a specific locale of the field, all locales are updated at once with provided values
object. If the field is present in the request and the value for some locale is omitted, that locale value will be cleared.
Collection field
key (string) - Field key specified in the spec file. Required.
items (array) - Items of a collection field. Required, but can be empty array.
Each collection item is an array of the fields. Refer to the section above describing non-collection field format.
A field of any type can be used inside collection, including collection field itself. But only two-level nesting is allowed - it means that collection field can have another (nested) collection inside its item, but no more.
Here is a complete example of a value for collection field countries
. It has two items with country_name
text field and largest_cities
nested collection. For each country there are three items in cities collection, represented by text field city_name
and number field population
.
Was this helpful?