Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Correcting links to the python doc pages

...

JSON Schemas primarily supplement /wiki/spaces/DOCS/pages/2667708522; you should understand annotations in Synapse before using JSON Schemas. This document also assumes you are comfortable with using the Synapse Python Client.

Note

JSON Schemas are an experimental feature in Synapse. Functionality in the web UI and programmatic clients is currently limited, but we have plans to improve support for managing organizations, schemas, and annotations in the near future.

...

Any object that has this schema will have the following derived annotations:

Annotation Key

Value

derivedFromConst

Derived Constant Value

derivedFromDefault

Derived Default Value

Conditionally Derived Annotations

JSON Schemas can also be written to conditionally apply annotations. For example, consider the following JSON Schema:

Code Block
languagejson
{
  "type": "object",
  "properties": {
    "country": {
      "type": "string",
      "enum": ["United States", "Canada"]
    },
    "if": {
      "properties": {
        "country": {
          "const": "United States"
        }
      },
      "required": ["country"]
    },
    "then": {
      "properties": {
        "measurementSystem": {
          "const": "Imperial"
        }
      }
    },
    "else": {
      "properties": {
        "measurementSystem": {
          "const": "Metric"
        }
      }
    }
  }
}

...