Open jomo02 opened 2 years ago
Same issue.
ConfluentSchemaRegistryValidationError: invalid ["null", "int", "long", "string"]: 7.5
The schema was previously registered and the relevant part looks like this:
{
"name": "value",
"type": ["null", "int", "long", "string"]
}
If I remove "int" from the union, it works.
Just ran into this as well. Any movement?
Hi - realise this is old, but we hit it recently using v3.3.0.
This can be solved by explicitly specifying the type of the union that you are using. It is the same technique used if there are objects in the union.
e.g.
{
"name": "value",
"type": ["null", "int", "long", "string"]
}
const registry = new SchemaRegistry({…});
await registry.encode(schemaId, {
value: { long: 75 },
});
Hi together,
I am running into the following error when I try to produce a message:
ConfluentSchemaRegistryValidationError: invalid ["null", "boolean", "double", "long"]: true
The schema was previously registered and the relevant part looks like this:
If I replace "long" e.g. with "string" I am able to produce, but when I'm using any combination of
double
,float
,long
andint
, I'm getting the described error.Maybe it has something to do with the fact that unions may not contain more than one schema with the same type (since there is only the
number
type in Typescript)?Thanks in advance!