Skip to content

Commit 0239fb8

Browse files
committed
Update schema management property initialization to reference schema title with custom nameKey given by user
1 parent 33342d0 commit 0239fb8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lib/components/common/jschema/schema_management.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ export class SchemaProperty {
154154
if (this.type === undefined && this.$ref !== undefined) {
155155
const resolvedSchema = resolveSchemaReference(this.$ref, this.globalSchema);
156156
Object.keys(resolvedSchema).forEach(schemaKey => {
157-
this[schemaKey] = resolvedSchema[schemaKey];
157+
if (this[schemaKey] === undefined)
158+
this[schemaKey] = resolvedSchema[schemaKey];
158159
});
159160
}
160161

@@ -254,7 +255,8 @@ export class SchemaProperty {
254255
}
255256

256257
// This should resolve the reference to the inner schema within the global schema
257-
this.properties[namedKey] = this.referenceSchema.additionalProperties;
258+
this.properties[namedKey] = JSON.parse(JSON.stringify(this.referenceSchema.additionalProperties));
259+
this.properties[namedKey].title = namedKey;
258260
this.properties[namedKey].value = propertyValue;
259261
}
260262
}

0 commit comments

Comments
 (0)