Last active
November 17, 2021 10:58
-
-
Save chriswk/0e90e4f5edf10ab2aca72b3604620dfc to your computer and use it in GitHub Desktop.
Unleash schema
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://json-schema.org/draft/2020-12/schema", | |
"$id": "https://docs.getunleash.io/schema/event.schema.json", | |
"title": "Unleash Event", | |
"description": "...", | |
"type": "object", | |
"required": ["eventId", "eventType", "featureName", "context"], | |
"properties": { | |
"eventId": { | |
"type": "string", | |
"format": "uuid", | |
"description": "The unique identifier for an event" | |
}, | |
"createdTimestamp": { | |
"type": "string", | |
"format": "date-time" | |
}, | |
"receivedTimestamp": { | |
"type": "string", | |
"format": "date-time" | |
}, | |
"eventType": { | |
"description": "Type of the event", | |
"oneOf": [ | |
{ | |
"enum": ["isEnabled"], | |
"description": "Event enabled" | |
}, | |
{ | |
"enum": ["getVariant"], | |
"description": "Get variant" | |
}, | |
{ | |
"enum": ["customGoal"], | |
"description": "Custom goal" | |
} | |
] | |
}, | |
"featureName": { | |
"type": "string", | |
"description": "The name of the feature the event happened to" | |
}, | |
"environment": { | |
"type": "string", | |
"description": "Which environment did this event happen in" | |
}, | |
"variant": { | |
"type": "string", | |
"description": "If this is a getVariant event, which variant did the user receive" | |
}, | |
"enabled": { | |
"type": "boolean", | |
"description": "Was the toggle enabled?" | |
}, | |
"context": { | |
"type": "object", | |
"description": "The unleash context at evaluation time", | |
"properties": { | |
"userId": { | |
"type": "string", | |
"description": "The id of the active user" | |
}, | |
"sessionId": { | |
"type": "string", | |
"description": "" | |
}, | |
"environment": { | |
"type": "string", | |
"description": "The environment set at client initialization time. *DEPRECATED*" | |
}, | |
"instanceId": { | |
"type": "string", | |
"description": "The instance id of the process running the client" | |
}, | |
"appName": { | |
"type": "string", | |
"description": "The name of the process running the client" | |
}, | |
"remoteAddr": { | |
"type": "string", | |
"format": "ipv4" | |
}, | |
"remoteHost": { | |
"type": "string" | |
}, | |
"properties": { | |
"type": "array", | |
"items": { | |
"type": "object", | |
"additionalProperties": { | |
"type": "string" | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment