I want to auto generate models in node.js based on the API spec file .Like model should contain setter method which we can use while passing the data to API .
Example of what i am looking at.How can i generate something like this as shown below.Any help is appreciated.
data: {
"name": "String",
"description": "String",
"externalId": "String",
"type": "String",
"members": "String"
}
i want model to be generated with method like
setName(name) {
data.name = name;
}
setDescription(description) {
data.description = description;
}
setExternalId(externalId) {
data.externalId = externalId;
}
setType(type) {
data.type = type;
}