11.) What is the use of the $ref keyword in JSON Schema?
A) To reference external files
B) To include reusable schema definitions
C) To define a default value
D) To specify required properties
12.) What is the difference between allOf and oneOf in JSON Schema?
A) allOf validates all schemas, oneOf validates only one schema
B) allOf is for strings, oneOf is for arrays
C) oneOf requires at least one match, allOf requires none
D) allOf allows duplicates, oneOf does not
13.) How do you specify a pattern for a string in JSON Schema?
A) match
B) regex
C) pattern
D) format
14.) What does the type keyword accept for mixed data types?
A) A single string
B) An array of types
C) A numeric range
D) A boolean flag
15.) Which keyword restricts the number of items in a JSON array?
A) minLength
B) maxItems
C) maxSize
D) arrayLimit
16.) What is the purpose of the dependencies keyword in JSON Schema?
A) To define key dependencies
B) To validate nested objects
C) To specify default values
D) To define type constraints
17.) What is the default value of additionalProperties in JSON Schema?
A) false
B) true
C) undefined
D) null
18.) How do you validate that a JSON object has no additional fields?
A) additionalProperties: false
B) maxProperties: 0
C) properties: []
D) additionalFields: false
19.) How do you specify a format for email validation in JSON Schema?
A) type: “email”
B) pattern: “/[email]/”
C) format: “email”
D) validate: “email”
20.) What does the title keyword do in JSON Schema?
A) Sets a required field
B) Provides a description of the schema
C) Gives a short label to the schema or property
D) Specifies a string pattern
Related