Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fix conditionally derived annotation JSON Schema

...

Code Block
languagejson
{
  "type": "object",
  "properties": {
    "country": {
      "type": "string",
      "enum": [
        "United States",
        "Canada"
      ]
    },
    "ifmeasurementSystem": {
      "type": "string"
    }
  },
  "propertiesif": {
    "properties": {
      "country": {
          "const": "United States"
 
      }
 
    },

     "required": [
      "country"]
    ]
  },

   "then": {
      "properties": {
        "measurementSystem": {
 
        "const": "Imperial"
        }
 
    }
 
  },

   "else": {
      "properties": {
        "measurementSystem": {
 
        "const": "Metric"
        }
      }
    }
  }
}

On an object where this schema is bound, the derived annotation value for measurementSystem of an object would depend on the actual annotation value of country.

...