Skip to content

Modeling structures that are mostly (but not completely) records #3310

Answered by bterlson
aabs asked this question in Q&A
Discussion options

You must be logged in to vote

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:

model Result {
   result_code: string;
   // etc.
   result_data: Record<ResultData>
}

model ResultData {
  ... Record<string>;
  
  time_stamp: string;
}

That is a strange timestamp format I have never seen before. Does it have a name?

Replies: 2 comments 17 replies

Comment options

You must be logged in to vote
14 replies
@bterlson
Comment options

@aabs
Comment options

@baywet
Comment options

@bterlson
Comment options

@baywet
Comment options

Answer selected by aabs
Comment options

You must be logged in to vote
3 replies
@baywet
Comment options

@aabs
Comment options

@baywet
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants