You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{
"$id": "http://example.com/oneof.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"description": "Sample schema to help you get started.",
"oneOf": [
{
"$ref": "http://example.com/lunch"
},
{
"$ref": "http://example.com/snow"
}
],
"title": "oneof",
"type": "object"
}
I also tried wrapping the "oneOf" object into properties, but alas, no success.
The dummy reference (works as expected):
{
"$id": "http://example.com/lunch.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"description": "Sample schema to help you get started.",
"properties": {
"lunch": {
"description": "The string type is used for strings of text.",
"type": "string"
}
},
"title": "lunch",
"type": "object"
}
The response I get from SchemaRegistry:
{
"subject": "schema-registry.oneof-value",
"version": 1,
"id": 100222,
"schemaType": "JSON",
"references": [
{
"name": "http://example.com/lunch",
"subject": "pub.schema-registry-poc-usafo.lunch-sux",
"version": 1
},
{
"name": "http://example.com/snow",
"subject": "pub.schema-registry-poc-usafo.snow-value",
"version": 2
}
],
"schema": "{\"$id\":\"http://example.com/oneof.schema.json\",\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"additionalProperties\":false,\"description\":\"Sample schema to help you get started.\",\"oneOf\":[{\"$ref\":\"http://example.com/lunch\"},{\"$ref\":\"http://example.com/snow\"}],\"title\":\"oneof\",\"type\":\"object\"}"
}
The text was updated successfully, but these errors were encountered:
Hi
How can I reference JSONSchemas (registered data contracts) with the
oneOf
keyword?I am stuck with trying to reference multiple JSONSchemas in on topic using
oneOf
keyword. I tried to follow this example: https://www.confluent.io/blog/multiple-event-types-in-the-same-kafka-topic/however, the given example is invalid:
I tried to use my data with this schema:
I also tried wrapping the
"oneOf"
object into properties, but alas, no success.The dummy reference (works as expected):
The response I get from SchemaRegistry:
The text was updated successfully, but these errors were encountered: