Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
{
"type": "object",
"title": "Generated schema for Root",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"name",
"pages",
"project",
"version"
],
"x-unique": [
"name",
"project"
],
"properties": {
Comment on lines +11 to +15
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Constrain unknown fields at the root.

Unless you intend to allow arbitrary keys, set additionalProperties to false to prevent config drift.

             "x-unique": [
                 "name",
                 "project"
             ],
+            "additionalProperties": false,
             "properties": {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"x-unique": [
"name",
"project"
],
"properties": {
"x-unique": [
"name",
"project"
],
"additionalProperties": false,
"properties": {
🤖 Prompt for AI Agents
In mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FormConfigTemplate
around lines 11 to 15, the JSON Schema currently defines x-unique and properties
but does not restrict unknown root-level keys; add "additionalProperties": false
at the root schema object (adjacent to the existing x-unique and properties
entries) to prevent arbitrary extra fields and config drift, ensuring validation
fails for any unspecified top-level keys.

"name": {
"enum": [
"REGISTRATIONFLOW",
"INVENTORYFLOW",
"ATTENDANCEFLOW",
"COMPLAINTFLOW",
"DELIVERYFLOW"
],
"type": "string"
},
"order": {
"type": "number"
},
Comment on lines +27 to +28
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Order should be integer with bounds.

If order is for sorting, prefer integer, non-negative.

-                "order": {
-                    "type": "number"
-                },
+                "order": {
+                    "type": "integer",
+                    "minimum": 0
+                },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"type": "number"
},
"order": {
"type": "integer",
"minimum": 0
},
🤖 Prompt for AI Agents
In mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FormConfigTemplate
around lines 27-28, the schema currently uses "type": "number" for the order
field; change this to an integer type and enforce non-negative bounds by
replacing with "type": "integer" and adding a "minimum": 0 (and optionally
"default": 0 if appropriate) so ordering is constrained to non-negative integers
for sorting.

"pages": {
"type": "array",
"items": {
"type": "object",
"required": [
"page",
"label",
"order",
"properties"
],
Comment on lines +29 to +38
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Pages array: enforce minItems and freeze page-object shape.

Strengthens validation and avoids empty configs.

-                "pages": {
-                    "type": "array",
+                "pages": {
+                    "type": "array",
+                    "minItems": 1,
                     "items": {
                         "type": "object",
                         "required": [
                             "page",
                             "label",
                             "order",
                             "properties"
                         ],
+                        "additionalProperties": false,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"pages": {
"type": "array",
"items": {
"type": "object",
"required": [
"page",
"label",
"order",
"properties"
],
"pages": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": [
"page",
"label",
"order",
"properties"
],
"additionalProperties": false,
🤖 Prompt for AI Agents
In mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FormConfigTemplate
around lines 29–38, strengthen validation by adding "minItems": 1 on the "pages"
array to prevent empty page lists, and freeze each page object shape by setting
"additionalProperties": false inside the "items" schema (and ensure the expected
"properties" object schema is explicitly declared if not already), keeping the
existing "required" list; this enforces at least one page and disallows
unspecified keys on page objects.

"properties": {
"page": {
"type": "string"
},
"type": {
"type": "string"
},
"label": {
"type": "string"
},
"order": {
"type": "number"
},
"navigateTo": {
"type": "object",
"required": [],
"properties": {
"name": {
"type": "string"
},
"type": {
"enum": [
"template",
"form"
],
"type": "string"
}
}
},
Comment on lines +52 to +67
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

navigateTo.required is empty; make name and type mandatory or drop required.

An empty required array is a no-op and may confuse maintainers.

-                            "navigateTo": {
+                            "navigateTo": {
                                 "type": "object",
-                                "required": [],
+                                "required": ["name", "type"],
                                 "properties": {
                                     "name": {
                                         "type": "string"
                                     },
                                     "type": {
                                         "enum": [
                                             "template",
                                             "form"
                                         ],
                                         "type": "string"
                                     }
-                                }
+                                },
+                                "additionalProperties": false
                             },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"navigateTo": {
"type": "object",
"required": [],
"properties": {
"name": {
"type": "string"
},
"type": {
"enum": [
"template",
"form"
],
"type": "string"
}
}
},
"navigateTo": {
"type": "object",
"required": ["name", "type"],
"properties": {
"name": {
"type": "string"
},
"type": {
"enum": [
"template",
"form"
],
"type": "string"
}
},
"additionalProperties": false
},
🤖 Prompt for AI Agents
In mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FormConfigTemplate
around lines 52–67 the "navigateTo" object defines a "required" array that is
empty; change this by either removing the empty "required" property entirely or,
if both fields should be mandatory, replace the empty array with "required":
["name", "type"] so that name and type are enforced as required properties and
the schema no longer contains a no-op empty required list.

"properties": {
"type": "array",
"items": {
"type": "object",
"required": [
"type",
"label",
"order",
"format",
"hidden"
],
"properties": {
Comment on lines +69 to +79
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Fields array: enforce minItems and freeze field-object shape.

Prevents empty pages and unexpected keys.

-                            "properties": {
-                                "type": "array",
+                            "properties": {
+                                "type": "array",
+                                "minItems": 1,
                                 "items": {
                                     "type": "object",
                                     "required": [
                                         "type",
                                         "label",
                                         "order",
                                         "format",
                                         "hidden"
                                     ],
+                                    "additionalProperties": false,

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FormConfigTemplate
around lines 69 to 79, the "fields" array schema currently allows empty arrays
and extra unexpected keys in each field object; add "minItems": 1 to the array
schema to prevent empty pages and set "additionalProperties": false on the field
object (inside "items") to freeze the allowed shape so unknown keys are
rejected; ensure this change sits alongside the existing
"type"/"items"/"properties"/"required" definitions so validation enforces at
least one field and rejects extraneous properties.

"type": {
"type": "string"
},
"enums": {
"type": "array",
"items": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
},
Comment on lines +84 to +96
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enum options should require code and name, and be non-empty.

Ensures each option is usable.

-                                        "enums": {
+                                        "enums": {
                                             "type": "array",
+                                            "minItems": 1,
                                             "items": {
                                                 "type": "object",
+                                                "required": ["code", "name"],
                                                 "properties": {
                                                     "code": {
                                                         "type": "string"
                                                     },
                                                     "name": {
                                                         "type": "string"
                                                     }
-                                                }
+                                                },
+                                                "additionalProperties": false
                                             }
                                         },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"type": "array",
"items": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
},
"enums": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": ["code", "name"],
"properties": {
"code": {
"type": "string"
},
"name": {
"type": "string"
}
},
"additionalProperties": false
}
},
🤖 Prompt for AI Agents
In mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FormConfigTemplate
around lines 84 to 96, the enum options schema allows objects with missing or
empty code/name; update the array/item schema to require both properties and
prevent empty strings by adding "required": ["code","name"] inside the items
object, add "minLength": 1 to the "code" and "name" property definitions, and
add "minItems": 1 to the outer array so the options array itself cannot be
empty.

"label": {
"type": "string"
},
"order": {
"type": "number"
},
"format": {
"type": "string"
},
"hidden": {
"type": "boolean"
},
"tooltip": {
"type": "string"
},
"helpText": {
"type": "string"
},
"infoText": {
"type": "string"
},
"readOnly": {
"type": "boolean"
},
"required": {
"type": "boolean"
},
"fieldName": {
"type": "string"
},
"deleteFlag": {
"type": "boolean"
},
"innerLabel": {
"type": "string"
},
"schemaCode": {
"type": "string"
},
"systemDate": {
"type": "boolean"
},
"validations": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"value": {},
"message": {
"type": "string"
}
}
}
},
Comment on lines +139 to +153
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Validation rules: make fields required and disallow extras.

Without required, empty objects pass.

-                                        "validations": {
+                                        "validations": {
                                             "type": "array",
                                             "items": {
                                                 "type": "object",
+                                                "required": ["type", "message"],
                                                 "properties": {
                                                     "type": {
                                                         "type": "string"
                                                     },
                                                     "value": {},
                                                     "message": {
                                                         "type": "string"
                                                     }
-                                                }
+                                                },
+                                                "additionalProperties": false
                                             }
                                         },

If you have a fixed set of validation types (min, max, regex, length, pattern, required), I can add an enum and per-type value typing via if/then.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"validations": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"value": {},
"message": {
"type": "string"
}
}
}
},
"validations": {
"type": "array",
"items": {
"type": "object",
"required": ["type", "message"],
"properties": {
"type": {
"type": "string"
},
"value": {},
"message": {
"type": "string"
}
},
"additionalProperties": false
}
},
🤖 Prompt for AI Agents
In mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FormConfigTemplate
around lines 139 to 153, the validations schema allows empty objects and
arbitrary extra fields; make the validation objects strict by adding "required":
["type","value","message"] (or at least ["type","message"] if value can be
optional) and set "additionalProperties": false on the items; also constrain
"type" with an "enum" of allowed validation types (e.g.
min,max,regex,length,pattern,required) and consider using JSON Schema if/then
blocks to type the "value" field per "type" so each validation has the proper
shape.

"errorMessage": {
"type": "string"
},
"includeInForm": {
"type": "boolean"
},
"isMultiSelect": {
"type": "boolean"
},
"includeInSummary": {
"type": "boolean"
},
"autoFillCondition": {
"type": "array",
"items": {
"type": "object",
"properties": {
"value": {},
"expression": {
"type": "string"
}
}
}
},
Comment on lines +166 to +177
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

autoFillCondition: require expression and freeze item shape.

Prevents accidental empty rule objects.

-                                        "autoFillCondition": {
+                                        "autoFillCondition": {
                                             "type": "array",
                                             "items": {
                                                 "type": "object",
+                                                "required": ["expression"],
                                                 "properties": {
                                                     "value": {},
                                                     "expression": {
                                                         "type": "string"
                                                     }
-                                                }
+                                                },
+                                                "additionalProperties": false
                                             }
                                         },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"autoFillCondition": {
"type": "array",
"items": {
"type": "object",
"properties": {
"value": {},
"expression": {
"type": "string"
}
}
}
},
"autoFillCondition": {
"type": "array",
"items": {
"type": "object",
"required": ["expression"],
"properties": {
"value": {},
"expression": {
"type": "string"
}
},
"additionalProperties": false
}
},
🤖 Prompt for AI Agents
In mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FormConfigTemplate
around lines 166 to 177, the autoFillCondition array items allow empty objects
and missing expressions; update the item schema to require the "expression"
property and prevent extra properties by adding "required": ["expression"] and
"additionalProperties": false (and optionally tighten "value" type if known) so
each array entry must contain an expression and cannot include arbitrary fields.

"visibilityCondition": {
"type": "object",
"properties": {
"expression": {
"type": "string"
}
}
}
Comment on lines +178 to +185
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

visibilityCondition: require expression and disallow extras.

Consistency with autoFillCondition and reduces parsing ambiguities.

-                                        "visibilityCondition": {
+                                        "visibilityCondition": {
                                             "type": "object",
+                                            "required": ["expression"],
                                             "properties": {
                                                 "expression": {
                                                     "type": "string"
                                                 }
-                                            }
+                                            },
+                                            "additionalProperties": false
                                         }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"visibilityCondition": {
"type": "object",
"properties": {
"expression": {
"type": "string"
}
}
}
"visibilityCondition": {
"type": "object",
"required": ["expression"],
"properties": {
"expression": {
"type": "string"
}
},
"additionalProperties": false
}
🤖 Prompt for AI Agents
In mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FormConfigTemplate
around lines 178 to 185, the visibilityCondition schema currently allows missing
expression and extra properties; update the object schema to require the
"expression" property and forbid additional properties to match
autoFillCondition and eliminate parsing ambiguity — add "required":
["expression"] and "additionalProperties": false to the visibilityCondition
definition.

}
}
},
"actionLabel": {
"type": "string"
},
"description": {
"type": "string"
}
}
}
},
"project": {
"type": "string"
},
"summary": {
"type": "boolean"
},
"version": {
"type": "number"
},
"disabled": {
"type": "boolean"
}
}
},