I'm trying to use yeoman to take this JSON file:
{
"models": {
"user": {
"properties": [
{
"name": {
"type": "string"
},
"surname": {
"type": "string"
},
"id": "number"
}
]
}
}
}
And turn it into something like:
Class User {
name : string
surname : string
id : number
}
Would it be possible to do some form of looping in the template? Here's what I have in mind...
export class <%= entityName %> extends Model {
<% forEach (property in props) { %>
<%= property.name %> : <% property.type %>;
<% } %>
}