odin-jsonschema

Implementation of JSON schema for Odin
Log | Files | Refs | LICENSE

schema.json (673B)


      1 {
      2   "$schema": "https://json-schema.org/draft/2020-12/schema",
      3   "type": "object",
      4   "properties": {
      5     "shape": {
      6       "oneOf": [{ "$ref": "#/$defs/circle" }, { "$ref": "#/$defs/rect" }]
      7     },
      8     "value": {
      9       "oneOf": [{ "type": "string" }, { "type": "number" }]
     10     }
     11   },
     12   "required": ["shape", "value"],
     13   "$defs": {
     14     "circle": {
     15       "type": "object",
     16       "properties": {
     17         "radius": { "type": "number" }
     18       },
     19       "required": ["radius"]
     20     },
     21     "rect": {
     22       "type": "object",
     23       "properties": {
     24         "width": { "type": "number" },
     25         "height": { "type": "number" }
     26       },
     27       "required": ["width", "height"]
     28     }
     29   }
     30 }