confluentinc / confluentinc/confluent-kafka-javascript
unknown format "email" ignored in schema at path
- Dominant language
- TypeScript
- Stars
- 304
- Forks
- 45
- Avg merge
- 11h 47m
- Merged PRs (30d)
- 5
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:
```json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://example.com/email-format-example",
"type": "object",
"properties": {
"email": {
"type": "string",
"format": "email"
}
}
}
```
```javascript
const payload = {
email: "someone@example.com"
}
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:
```javascript
import Ajv2020 from "ajv/dist/2020"
import addFormats from "ajv-formats"
const ajv = new Ajv()
addFormats(ajv)
```
Contributor guide
Assessment
This issue has not been assessed yet.