0
0
Postmantesting~10 mins

JSON Schema validation in Postman - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the type of the property in JSON Schema.

Postman
{
  "type": "object",
  "properties": {
    "name": { "type": "[1]" }
  }
}
Drag options to blanks, or click blank then click option'
Astring
Bnumber
Cboolean
Darray
Attempts:
3 left
💡 Hint
Common Mistakes
Using number or boolean type for text properties.
Leaving the type undefined.
2fill in blank
medium

Complete the code to require the property in JSON Schema.

Postman
{
  "type": "object",
  "properties": {
    "age": { "type": "number" }
  },
  "[1]": ["age"]
}
Drag options to blanks, or click blank then click option'
Adefinitions
Boptional
Cproperties
Drequired
Attempts:
3 left
💡 Hint
Common Mistakes
Using optional instead of required.
Placing required properties inside properties incorrectly.
3fill in blank
hard

Fix the error in the JSON Schema to correctly validate an array of strings.

Postman
{
  "type": "array",
  "items": { "type": "[1]" }
}
Drag options to blanks, or click blank then click option'
Aobject
Bnumber
Cstring
Dboolean
Attempts:
3 left
💡 Hint
Common Mistakes
Using object or number instead of string.
Omitting the items keyword.
4fill in blank
hard

Fill both blanks to define a property with a minimum length of 5 characters.

Postman
{
  "type": "object",
  "properties": {
    "username": {
      "type": "string",
      "[1]": 5,
      "[2]": 10
    }
  }
}
Drag options to blanks, or click blank then click option'
AminLength
BmaxLength
Cminimum
Dmaximum
Attempts:
3 left
💡 Hint
Common Mistakes
Using minimum or maximum which are for numbers, not strings.
Swapping minLength and maxLength.
5fill in blank
hard

Fill all three blanks to define a property that must be an integer between 1 and 100 inclusive.

Postman
{
  "type": "object",
  "properties": {
    "score": {
      "type": "[1]",
      "[2]": 1,
      "[3]": 100
    }
  },
  "required": ["score"]
}
Drag options to blanks, or click blank then click option'
Ainteger
Bminimum
Cmaximum
Dnumber
Attempts:
3 left
💡 Hint
Common Mistakes
Using number instead of integer.
Swapping minimum and maximum values.