in src/app/shared/utils/jsonSchemaAdaptor.ts [66:86]
constructor(model: ModelDefinition) {
// preprocess model to flatten if content is within schema
if (model && !model.contents && model.schema) {
this.model = JSON.parse(JSON.stringify(model)); // important: needs this deep copy to prevent model got changed
this.model.contents = model.schema.contents;
}
else {
this.model = model;
}
const reusableSchema = model && model.schemas || [];
this.definitions = {} as any; // tslint:disable-line: no-any
reusableSchema.forEach(schema => {
try {
const parsedReusableSchema = this.parseInterfaceContentSchemaHelper(schema);
this.definitions[schema['@id']] = parsedReusableSchema;
}
catch {
this.definitions[schema['@id']] = {};
}
});
}