Comment

To add comments in your JSON Schema, use the $comment keyword. The $comment keyword is a string that provides additional information about the schema.

1{
2  "type": "string",
3  "$comment": "This is a comment"
4}

Default

You can set a default value for a property using the default keyword. The default keyword is used to provide a default value for a property.

1{
2  "type": "string",
3  "default": "Hello World"
4}

Remember: These keywords are not used for validation purposes. They are used to provide additional information about the schema.

Task

1{
2  "name": {
3    "firstName": "John",
4    "lastName": "Doe"
5  },
6  "age": 25
7}

You are given schema of the above JSON object in side editor.

  • Add any comment to the name property.
  • Set any default value to the age property.
Loading...
Output
Please click the button or use
Shift+Enter
to view the output