Skip to main content

Generator configuration

jsonSchemaHint

Commentary​

added in 0.10.10

local configuration

Explicitly defines the JSON Schema for generated data. Takes a map of generator keys to JSON schemas.


Examples​

Providing the JSON schema​

Set the keys in the map to the fields in the generator. In this example, the schema is defined for the value field in Kafka events tracked by Schema Registry.

{
"generators": [
{
"topic": "sandbox",
"value": {
"_gen": "normalDistribution",
"mean": 10,
"sd": 5,
"clamp": [
0,
15
]
},
"localConfigs": {
"jsonSchemaHint": {
"value": {
"type": "number",
"minimum": 0
}
}
}
}
],
"connections": {
"kafka": {
"kind": "kafka",
"producerConfigs": {
"bootstrap.servers": "localhost:9092",
"schema.registry.url": "http://localhost:8081",
"key.serializer": "io.confluent.kafka.serializers.json.KafkaJsonSchemaSerializer",
"value.serializer": "io.confluent.kafka.serializers.json.KafkaJsonSchemaSerializer"
}
}
}
}

Specification​

JSON schema​

{
"type": "object"
}