+ {Object.entries(propSchema.properties).map(
+ ([fieldName, fieldSchema]) => {
+ const fieldPath = [...path, fieldName];
+ const fieldValue = objectValue[fieldName];
+ const fieldRequired = isFieldRequired([fieldName]);
+
+ return (
+
+
+ {fieldSchema.description && (
+
+ {fieldSchema.description}
+
+ )}
+
+ {renderFieldInput(
+ fieldSchema,
+ fieldValue,
+ fieldPath,
+ fieldRequired,
+ )}
+
+
+ );
+ },
+ )}
+
+ );
+ }
+
+ const fieldRequired = isFieldRequired(path);
+ return renderFieldInput(propSchema, currentValue, path, fieldRequired);
+ };
+
+ const renderFieldInput = (
+ propSchema: JsonSchemaType,
+ currentValue: JsonValue,
+ path: string[],
+ fieldRequired: boolean,
+ ) => {
switch (propSchema.type) {
- case "string":
+ case "string": {
+ if (propSchema.enum) {
+ return (
+