An array is an ordered JSON value whose entries can be described and validated as a group. In a search request, fields is an array of requested book fields. section 7.2
JSON Schema marks the value with type "array" and describes each entry through items. The schema can require strings, restrict values with enum, and require the array field itself. section 7.2
Validating requested fields
A request such as {"title":"habit","fields":["title","weight","number_of_pages"]} validates when fields contains strings. A misspelled title property makes the request invalid when title is required. section 7.2
Listing 7.4 Schema for search request with information about array elements
{
"type": "object",
"properties": {
"title": {"type": "string"},
"fields": {
"type": "array",
"items": {"type": "string"}
}
}
}
Inspect the schema that adds string constraints to every array element. section 7.2







































