Cast STRUCT to ARRAY of STRUCT

Hello everyone,
I needs your help with KSQLDB.
I get messages in a topic where the structure either comes as an STRUCT or as ARRAY with STRUCTs (SkuLine).
I would like to change the structure i a way, that the structure is always an ARRAY with STRUCTs, even if there is just one element.
So I would be able to define a schema on it.

Is there an option to CAST a STRUCT to an ARRAY or something similar?

ARRAY:

"saleLines": {
    "SkuLine": [{
          key:value,
          key:value
       },
      {
         key:value,
         key:value
       }],
  },...

STRUCT

"saleLines": {
    "SkuLine": {
        key:value,
        key:value
     }
},...

This topic was automatically closed after 30 days. New replies are no longer allowed.