Skip to content

Commit 8c8c87a

Browse files
authored
chore(orchestrator): add pattern AJV check to the example schema (#846)
Signed-off-by: Marek Libra <marek.libra@gmail.com>
1 parent 8ab0a7b commit 8c8c87a

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

workspaces/orchestrator/plugins/orchestrator-form-widgets/http-workflow-dev-server/exampleWorkflows/schemas/dynamic-course-select__main-schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"properties": {
77
"studentName": {
88
"type": "string",
9-
"title": "Student name (standard HTML component)"
9+
"title": "Student name (standard HTML component)",
10+
"pattern": "^[A-Z]([-a-z0-9]*[a-zA-Z0-9])?$"
1011
},
1112
"courseName": {
1213
"type": "string",

workspaces/orchestrator/plugins/orchestrator-form-widgets/src/utils/useGetExtraErrors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
// useWrapperFormPropsContext,
2222
} from '@red-hat-developer-hub/backstage-plugin-orchestrator-form-api';
2323
import { JsonObject } from '@backstage/types';
24-
import { ErrorSchema } from '@rjsf/utils';
24+
import { ERRORS_KEY, ErrorSchema } from '@rjsf/utils';
2525
import { useTemplateUnitEvaluator } from './useTemplateUnitEvaluator';
2626
import { evaluateTemplate } from './evaluateTemplate';
2727
import { getRequestInit } from './useRequestInit';
@@ -117,7 +117,7 @@ export const useGetExtraErrors = () => {
117117
) as string[];
118118

119119
safeSet(errors, path, {
120-
__errors: array.map(e => e?.toString()),
120+
[ERRORS_KEY]: array.map(e => e?.toString()),
121121
});
122122
}
123123
});

0 commit comments

Comments
 (0)