Hi All
I have a schema registry entry… but it seems when creating a stream based on json i need to include schema, how do I model the below in the create schema.
Schema registry entry
salesbasket
{
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"BasketItems": {
"items": [
{
"properties": {
"Brand": {
"type": "string"
},
"Catergory": {
"type": "string"
},
"Id": {
"type": "string"
},
"Name": {
"type": "string"
},
"Price": {
"type": "number"
},
"Quantity": {
"type": "integer"
}
},
"required": [
"Id",
"Name",
"Brand",
"Catergory",
"Price",
"Quantity"
],
"type": "object"
}
],
"type": "array"
},
"Clerk": {
"properties": {
"Id": {
"type": "string"
},
"Name": {
"type": "string"
}
},
"required": [
"Id",
"Name"
],
"type": "object"
},
"InvoiceNumber": {
"type": "string"
},
"Net": {
"type": "number"
},
"SaleDateTime": {
"format": "date",
"type": "string"
},
"Store": {
"properties": {
"Id": {
"type": "string"
},
"Name": {
"type": "string"
}
},
"required": [
"Id",
"Name"
],
"type": "object"
},
"TerminalPoint": {
"type": "string"
},
"Total": {
"type": "number"
},
"VAT": {
"type": "number"
}
},
"required": [
"InvoiceNumber",
"SaleDateTime",
"Store",
"Clerk",
"TerminalPoint",
"BasketItems",
"Net",
"VAT",
"Total"
],
"type": "object"
}
Actual data
{
"InvoiceNumber": "1341243123341232",
"SaleDateTime": "2023-12-12-T13:22:37+02:00",
"Store" : {
"Id": "2143412",
"Name": "sdfgsjdjndnjdfgs"
},
"Clerk": {
"Id": "231",
"Name": "grfvnowifgbvuwe"
},
"TerminalPoint": "124",
"BasketItems":[
{
"Id": "234123412",
"Name": "",
"Brand": "fgtwruyergfd",
"Catergory": "",
"Price":12412.00,
"Quantity":3
},
{
"Id": "234123421",
"Name": "fgtwergo678d",
"Brand": "",
"Catergory": "",
"Price":12.00,
"Quantity":3
},
],
"Net": 442.23,
"VAT":10.00,
"Total":452.23
}