Encountering an error message when attempting to retrieve the description
attribute from the following Sample Json.
Error: TypeError: Cannot read property 'description' of undefined when trying to access json data in typescript
import {Age} from "./sample"
var a:Age;
console.log(a.description);
Sample.json :
{
"title":"Example Schema",
"type":"object",
"properties":{
"firstName":{
"type":"string"
},
"lastName":{
"type":"string"
},
"age":{
"description":"Age in years",
"type":"integer",
"minimum":0
},
"hairColor":{
"enum":[
"black",
"brown",
"blue"
],
"type":"string"
}
},
"additionalProperties":false,
"required":[
"firstName",
"lastName"
]
}