Skip to main content
Version: 1.2.0

Root Choice Event

An example event that has oneOf at the root level.

Please select one of the following options:

View Raw JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://tracking-docs-demo.buchert.digital/schemas/1.2.0/events/root-choice-event.json",
  "title": "Root Choice Event",
  "description": "An example event that has oneOf at the root level.",
  "allOf": [
    {
      "type": "object",
      "properties": {
        "$schema": {
          "type": "string",
          "description": "Defines the structure of the event. This can be used to validate an event against the schema provided.",
          "const": "https://tracking-docs-demo.buchert.digital/schemas/1.2.0/events/root-choice-event.json"
        }
      },
      "required": [
        "$schema"
      ]
    },
    {
      "oneOf": [
        {
          "title": "Option A",
          "$anchor": "option_a",
          "description": "This is the description for Param A.",
          "type": "object",
          "properties": {
            "event": {
              "type": "string",
              "const": "option_a",
              "description": "The event name."
            },
            "param_a": {
              "type": "string",
              "description": "A string parameter for option A.",
              "examples": [
                "example_a"
              ]
            }
          }
        },
        {
          "title": "Option B",
          "$anchor": "option_b",
          "type": "object",
          "properties": {
            "event": {
              "type": "string",
              "const": "option_b",
              "description": "The event name."
            },
            "param_b": {
              "type": "integer",
              "description": "An integer parameter for option B.",
              "examples": [
                123
              ]
            }
          }
        }
      ]
    }
  ]
}