Currently, I am facing a challenge while working on my project which involves processing "large" JSON files. These files are fetched from an online MongoDB (Mongo Atlas) and accessed through a simple node JavaScript REST API. The complexity of the JSON data is making it difficult for me to figure out how to proceed. Typically, I would create a model to handle such JSON structures, but in this particular case, I am unsure about the approach to take. You can view the schema here.
The JSON has numerous nested arrays, which raises the question: should I use classes or interfaces? Would I need to create a new class for each array?
Previously, I was using the following model in JavaScript: (but this does not work in TypeScript due to undefined object)
export class Match{
constructor(
public _id: string,
public game: Object
){}
}
I am aware that I could potentially import the entire Swagger UI into my project, although I am uncertain about the process (https://www.npmjs.com/package/swagger-ts-generator). However, I only require the specific schema mentioned above.
Any guidance or assistance on this matter would be greatly appreciated.