diff --git a/plugins/scaffolder/src/next/TemplateWizardPage/Stepper/schema.test.ts b/plugins/scaffolder/src/next/TemplateWizardPage/Stepper/schema.test.ts
new file mode 100644
index 0000000000..b368b832a4
--- /dev/null
+++ b/plugins/scaffolder/src/next/TemplateWizardPage/Stepper/schema.test.ts
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2022 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { extractSchemaFromManifest } from './schema';
+
+describe('schema utils', () => {
+ it('should do stuff', () => {
+ const inputSchema = {
+ type: 'object',
+ 'ui:welp': 'warp',
+ properties: {
+ field1: {
+ type: 'string',
+ 'ui:derp': 'herp',
+ },
+ field2: {
+ type: 'object',
+ properties: {
+ fieldX: {
+ type: 'string',
+ 'ui:derp': 'xerp',
+ },
+ },
+ },
+ },
+ };
+ const expectedSchema = {
+ type: 'object',
+ properties: {
+ field1: {
+ type: 'string',
+ },
+ field2: {
+ type: 'object',
+ properties: {
+ fieldX: {
+ type: 'string',
+ },
+ },
+ },
+ },
+ };
+ const expectedUiSchema = {
+ 'ui:welp': 'warp',
+ field1: {
+ 'ui:derp': 'herp',
+ },
+ field2: {
+ fieldX: {
+ 'ui:derp': 'xerp',
+ },
+ },
+ };
+
+ expect(
+ extractSchemaFromManifest({
+ title: 'test',
+ steps: [{ title: 'test', schema: inputSchema }],
+ }),
+ ).toEqual({
+ schema: expectedSchema,
+ uiSchema: expectedUiSchema,
+ });
+ });
+});
diff --git a/plugins/scaffolder/src/next/TemplateWizardPage/Stepper/schema.ts b/plugins/scaffolder/src/next/TemplateWizardPage/Stepper/schema.ts
index b61d59e88d..6140cfd978 100644
--- a/plugins/scaffolder/src/next/TemplateWizardPage/Stepper/schema.ts
+++ b/plugins/scaffolder/src/next/TemplateWizardPage/Stepper/schema.ts
@@ -13,3 +13,27 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+import { UiSchema } from '@rjsf/core';
+import { JSONSchema7 } from 'json-schema';
+
+import { TemplateParameterSchema } from '../../../types';
+
+export const extractSchemaFromManifest = (
+ manifest: TemplateParameterSchema,
+): { uiSchema: UiSchema; schema: JSONSchema7 } => {
+ const schema = manifest.steps[0].schema;
+ const uiSchema = JSON.parse(JSON.stringify(schema), (key, value) => {
+ if (typeof value === 'object') {
+ return Object.fromEntries(
+ Object.entries(value).filter(
+ ([k, v]) => k.startsWith('ui:') || typeof v === 'object',
+ ),
+ );
+ }
+
+ return value;
+ });
+
+ console.log(uiSchema);
+ return { uiSchema, schema: {} };
+};
diff --git a/plugins/scaffolder/src/next/TemplateWizardPage/TemplateWizardPage.tsx b/plugins/scaffolder/src/next/TemplateWizardPage/TemplateWizardPage.tsx
index 5e0b20d468..58059f55bf 100644
--- a/plugins/scaffolder/src/next/TemplateWizardPage/TemplateWizardPage.tsx
+++ b/plugins/scaffolder/src/next/TemplateWizardPage/TemplateWizardPage.tsx
@@ -90,7 +90,7 @@ export const TemplateWizardPage = (_props: TemplateWizardPageProps) => {
noPadding
titleTypographyProps={{ component: 'h2' }}
>
-
+
)}