60 | {(construct || methodWithId) && (
61 |
62 | )}
63 |
64 | {props.items.required.length > 0 && (
65 |
66 |
72 |
73 |
79 | Required
80 |
81 |
82 |
83 | )}
84 | {props.items.required.map((item) => (
85 |
93 | ))}
94 | {((props.items.required.length > 0 && props.items.optional.length > 0) ||
95 | (construct && props.items.optional.length > 0)) && (
96 |
97 |
103 |
104 |
110 | Optional
111 |
112 |
113 |
114 | )}
115 | <>
116 | {props.items.optional.map((item) => (
117 |
125 | ))}
126 | >
127 |
128 | );
129 | }
130 |
--------------------------------------------------------------------------------
/src/react-app/src/project/validator.ts:
--------------------------------------------------------------------------------
1 | import {
2 | ParameterMetadata,
3 | PropertyMetadata,
4 | TypeMetadata,
5 | TypeTest,
6 | } from "../types";
7 | import { ItemsHelper } from "./helpers/items-helper";
8 | import { ValuesHelper } from "./helpers/values-helper";
9 | import { Values, ValueMetadata, CoreValue } from "./types/values";
10 |
11 | const valuesHelper = new ValuesHelper();
12 | const itemsHelper = new ItemsHelper();
13 |
14 | export interface ValueError {
15 | key: string;
16 | valueId: string;
17 | }
18 |
19 | export class Validator {
20 | static validate(
21 | root: CoreValue,
22 | values: { [valueId: string]: ValueMetadata },
23 | types: { [fqn: string]: TypeMetadata }
24 | ) {
25 | const visited = new Set