{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Schema with default values ",

  "definitions": {
    "RandomObject": {
      "type": "object",
      "properties": {
        "stringValue_missing": {
          "description": "the test data does not have this attribute, so default should be applied if the ApplyDefaultsStrategy requires it",
          "type": "string",
          "default": "hello"
        },
        "stringValue_missing_with_default_null": {
          "description": "the test data does not have this attribute, so default as null should be applied if the ApplyDefaultsStrategy requires it",
          "type": "string",
          "default": null
        },
        "stringValue_missing_with_no_default": {
          "description": "the test data does not have this attribute, no default value should be applied",
          "type": "string"
        }
      },
      "required": [
        "stringValue_missing"
      ]
    }
  },

  "type": "object",
  "properties": {
    "outer": {
      "type": "object",
      "properties": {
        "mixedObject": {
          "type": "object",
          "properties": {
            "intValue_present": {
              "description": "the test data supplies a value for this attribute so the default is ignored",
              "type": "integer",
              "default": 5
            },
            "intValue_missing": {
              "description": "the test data does not have this attribute, so default should be applied if the ApplyDefaultsStrategy requires it",
              "type": "integer",
              "default": 15
            },
            "intValue_missing_notRequired": {
              "description": "the test data does not have this attribute, so default should be applied if the ApplyDefaultsStrategy requires it",
              "type": "integer",
              "default": 25
            },
            "intValue_null": {
              "description": "the test data supplies the value null for this attribute so the default should be applied if the ApplyDefaultsStrategy requires it",
              "type": "integer",
              "default": 35
            },
            "intValue_missingButError": {
              "description": "the test data does not have this attribute, so default should be applied if the ApplyDefaultsStrategy requires it, but the default is wrong so there should be an error",
              "type": "integer",
              "default": "forty-five"
            }
          },
          "additionalProperties": false,
          "required": [
            "intValue_present",
            "intValue_missing",
            "intValue_null",
            "intValue_missingButError"
          ]
        },

        "goodArray": {
          "type": "array",
          "items": {
            "description": "if an item in the array is null, then default value should be applied if the ApplyDefaultsStrategy requires it",
            "type": "string",
            "default": "five"
          }
        },

        "badArray": {
          "type": "array",
          "items": {
            "description": "if an item in the array is null, then default value should be applied if the ApplyDefaultsStrategy requires it, but the default is wrong so there should be an error",
            "type": "string",
            "default": 5
          }
        },

        "reference": {
          "$ref": "#/definitions/RandomObject"
        }
      },
      "additionalProperties": false,
      "required": ["mixedObject", "goodArray", "badArray", "reference"]
    }
  },
  "additionalProperties": false,
  "required": ["outer"]
}
