-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
Description
Environment Information
- OS [e.g. Mac, Arch, Windows 10]: Mac
- Node Version [e.g. 8.2.1]: 22.11.0
- NPM Version [e.g. 5.4.2]:10.9.0
- C++ Toolchain [e.g. Visual Studio, llvm, g++]:
- confluent-kafka-javascript version [e.g. 2.3.3]: 1.6.0
Steps to Reproduce
Schema:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://example.com/email-format-example",
"type": "object",
"properties": {
"email": {
"type": "string",
"format": "email"
}
}
}const payload = {
email: "[email protected]"
}
const topic = 'mytopic'
const id = 1234
const ser = new JsonSerializer(registry, SerdeType.VALUE, { useSchemaId: id, validate: true });
await ser.serialize(topic, payload)confluent-kafka-javascript Configuration Settings
Additional context
Needs ajv-formats:
import Ajv2020 from "ajv/dist/2020"
import addFormats from "ajv-formats"
const ajv = new Ajv()
addFormats(ajv)