200-301 · Question #1340
What is represented in line 2 within this JSON schema?
The correct answer is A. object. In a typical JSON schema, 'object' often defines the type of a JSON structure, indicating it is a collection of key-value pairs.
Question
Options
- Aobject
- Bvalue
- Ckey
- Darray
How the community answered
(36 responses)- A89% (32)
- B3% (1)
- C6% (2)
- D3% (1)
Why each option
In a typical JSON schema, 'object' often defines the type of a JSON structure, indicating it is a collection of key-value pairs.
In a JSON schema, `type: object` is used to specify that the JSON data being described should be an object, which is an unordered collection of key-value pairs enclosed by curly braces. This definition typically appears at a high level within the schema to define the overall structure or for complex nested elements.
A value is the data associated with a key, not the type definition itself.
A key is the string label for a field in an object, not a type descriptor for the entire structure.
An array is an ordered list of values, which would be specified by `type: array` in a JSON schema, not `object`.
Concept tested: JSON schema object type identification
Source: https://json-schema.org/understanding-json-schema/reference/object
Topics
Community Discussion
No community discussion yet for this question.