JSON schema example (Method 1)
This is a JSON schema example for data objects that contain localized strings. In the example, method 1 is used:
{
"$schema":"http://json-schema.org/draft-06/schema#",
"type":"object",
"properties":{
"id":{
"description":"The identifier",
"type":"string",
"maxLength":40
},
"description":{
"description":"Additional information",
"type":"object",
"x-localized":true,
"x-propertiesMaxLength":250,
“additionalProperties”:true
}
}
}
Inside the data objects, localized properties must include the supported locales and their associated string values.
This example of a data object relates to the JSON schema example for data objects that contain localized strings:
{"id":"123","description":{"en_US":"car","es_ES":"coche"}}
The description
property contains values for two locales: en_US
and es_ES
.