Eventvisor

Concepts

JSON Schema

Eventvisor makes use of a subset of the JSON Schema specification when defining attribute and event schemas. Common structures can be shared through reusable Schemas.

Reusable definitions

Store a shared definition in schemas/ and reference it from an event, attribute, property, or array item:

schema: identifier

References are resolved during linting, code generation, and datafile builds. See Reusable Schemas for complete examples.

Supported types are listed below:

string

For simple strings (text values):

type: string

enum

You can specify a list of allowed values for a string:

type: string
enum:
- foo
- bar

maxLength

You can specify the maximum length for a string:

type: string
maxLength: 100

minLength

You can specify the minimum length for a string:

type: string
minLength: 0

pattern

You can specify a regular expression for a string:

type: string
pattern: ^[a-z]+$

Patterns use the same portable regular expression subset as conditions. This keeps validation consistent across SDK languages.

boolean

For boolean (true/false) values:

type: boolean

number

For numeric values (integer or float):

type: number

maximum

You can specify the maximum value for a number:

type: number
maximum: 100

minimum

You can specify the minimum value for a number:

type: number
minimum: 0

integer

For whole numbers only:

type: integer

Similar to number, you can also specify the maximum and minimum values for an integer.

object

Objects are strict by default. Properties not declared in properties fail validation.

For objects (key-value pairs):

type: object
properties:
firstProperty:
type: string
secondProperty:
type: number
required:
- firstProperty

additionalProperties

Allow undeclared properties explicitly when gradual adoption requires a looser boundary:

type: object
additionalProperties: true

The default is false. Prefer declaring known properties so Catalog, generated types, and validation describe the same contract.

Nested objects

You can also define nested objects:

type: object
properties:
firstProperty:
type: string
nested:
type: object
properties:
foo:
type: string
bar:
type: string
required:
- foo
- bar
required:
- firstProperty

array

For arrays:

type: array
items:
type: string

When inside an object:

type: object
properties:
arrayProperty:
type: array
items:
type: string
required:
- arrayProperty

maxItems

You can specify the maximum number of items for an array:

type: array
maxItems: 100

minItems

You can specify the minimum number of items for an array:

type: array
minItems: 0

uniqueItems

You can specify if the items in the array should be unique:

type: array
uniqueItems: true

Objects and arrays are compared structurally for uniqueItems, enum, and const. Property order does not change equality.

Common properties

You can make use of the following properties for all types above:

const

You can specify a constant value:

type: string
const: "foo"

default

You can specify a default value:

type: string
default: "default value"
Previous
Targets