Merge pull request #4874 from inrumi/id-collision-fix

Id collision fix
This commit is contained in:
Ben Lambert
2021-03-09 08:44:21 +01:00
committed by GitHub
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder': patch
---
Added a default type when is not defined in the schema to prevent id collision
@@ -63,6 +63,7 @@ function extractUiSchema(schema: JsonObject, uiSchema: JsonObject) {
export function transformSchemaToProps(
inputSchema: JsonObject,
): { schema: FormProps<any>['schema']; uiSchema: FormProps<any>['uiSchema'] } {
inputSchema.type = inputSchema.type || 'object';
const schema = JSON.parse(JSON.stringify(inputSchema));
delete schema.title; // Rendered separately
const uiSchema = {};