geckosio/geckos.io

Is there a way to define a int or float type fix length array in schema?

Closed this issue · 1 comments

hi @yandeu , sorry if I shouldnt post a question here, the Discussions board was closed for some reason.

I am wondering issue I can define a uint8 array to schema's property. so something like below, instead of listing all uint8 items, I want to have just one schema property to define as a uint8 array

export const inputSchema = BufferSchema.schema('input', { id: uint32, t: uint64, bb: uint8, sb: uint8, x: uint8, y: uint8, a: uint8, b: uint8, lb: uint8, rb: uint8, lt: uint8, rt: uint8, lsh: uint8, lsv: uint8, dph: uint8, dpv: uint8, v: int16, })

I tried, below but got error when it try to do stuff to the schema "data"
export const inputSchema = BufferSchema.schema('input', { id: uint32, t: uint64, data: [uint8], v: int16, })

Thanks for your help.

sorry this is a question to schema repo, close