-
Hi, Apologies for the noobie question. I'm still trying to find my feet with typespec. I'm dealing with a 3rd party telemetry API that delivers responses like this, and I'm unsure how to model it with typespec: I figure I can use a Is this possible/acceptable?
How could I model a structure like this (idiomatically)? FWIW, In practice this will be a very large payload with many records, and many data points beneath the records. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 17 replies
-
Yeah spreading of a record is acceptable and is the preferred way to represent this kind of thing where you have a known properties and then a bunch of unknown properties. So to me that looks like:
That is a strange timestamp format I have never seen before. Does it have a name? |
Beta Was this translation helpful? Give feedback.
-
Do you mean that, because there is a catch-all definition in there, the explicitly named property is ignored? |
Beta Was this translation helpful? Give feedback.
Yeah spreading of a record is acceptable and is the preferred way to represent this kind of thing where you have a known properties and then a bunch of unknown properties. So to me that looks like:
That is a strange timestamp format I have never seen before. Does it have a name?