Skip to content

Conversation

@Shreya-egov
Copy link
Collaborator

@Shreya-egov Shreya-egov commented Aug 22, 2025

Summary by CodeRabbit

  • New Features
    • Introduces a standardized template to configure multi-page forms for Registration, Inventory, Attendance, Complaint, and Delivery flows.
    • Supports page navigation, action labels, descriptions, and optional summary views.
    • Adds rich field controls: validations with messages, visibility and auto-fill conditions, read-only/required flags, hidden fields, tooltips/help/info text, enums, multi-select, and error messaging.
    • Enables per-form versioning and disable/enable flags for controlled rollout and management.

@Shreya-egov Shreya-egov requested a review from a team as a code owner August 22, 2025 07:06
@Shreya-egov Shreya-egov requested review from elzanmathew-eGov and removed request for a team August 22, 2025 07:06
@coderabbitai
Copy link

coderabbitai bot commented Aug 22, 2025

Walkthrough

Adds a new JSON Schema file defining a form configuration template with required root fields (name, pages, project, version), a name enum of five flows, and nested page/field structures including navigation, validations, visibility, auto-fill, and UI-related attributes. Includes summary/disabled flags and a uniqueness constraint on name+project.

Changes

Cohort / File(s) Summary
Schema Addition
mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FormConfigTemplate
New JSON Schema specifying a form configuration contract: root metadata, pages array (with labels, order, navigation), and properties array of fields (types, formats, visibility, validations, enums, flags). Includes name enum for flows, versioning, summary/disabled flags, and a unique name+project constraint.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Admin as Admin Console
  participant Config as FormConfig JSON
  participant Schema as JSON Schema Validator
  participant Store as MDMS Storage

  Admin->>Config: Create/Update FormConfig
  Admin->>Schema: Validate against HCM-ADMIN-CONSOLE.FormConfigTemplate
  alt Valid
    Schema-->>Admin: Validation OK
    Admin->>Store: Persist FormConfig (name+project)
    Store-->>Admin: Saved
  else Invalid
    Schema-->>Admin: Errors (fields/validators/navigation)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I hop through pages, fields in a row,
Five flows named where the carrots grow.
Labels, orders, rules that sing,
Validations thrum with a springy ping.
If schema smiles, I stamp and save—
A burrow of forms, tidy and brave. 🥕

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch Shreya-egov-patch-4

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 9

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FormConfigTemplate (1)

211-212: Fix invalid JSON: remove trailing comma and add missing closing brace

The JSON schema file ends with a dangling comma at line 211 and lacks the final } to close the root object, causing a parse failure (jq reports “Expected value before ‘,’ at line 211, column 10”). This will break schema validation and any MDMS loader.

Please apply the following patch to mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FormConfigTemplate:

--- a/mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FormConfigTemplate
+++ b/mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FormConfigTemplate
@@ around line 211
-        },
+        }
+}

Afterward, verify the JSON is valid:

jq -e . "mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FormConfigTemplate"
🧹 Nitpick comments (8)
mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FormConfigTemplate (8)

3-5: Schema metadata: use a meaningful title and consider adding $id (optional but recommended).

A descriptive title and an $id help tooling, bundling, and cross-ref.

-            "title": "Generated schema for Root",
+            "title": "HCM Admin Console • Form Config Template",
+            "$id": "mdms:hcm/admin-console/v0.4/form-config-template"

40-51: Tighten page fields.

Small guardrails: non-empty strings and integer order.

-                            "page": {
-                                "type": "string"
-                            },
+                            "page": { "type": "string", "minLength": 1 },
                             "type": {
                                 "type": "string"
                             },
-                            "label": {
-                                "type": "string"
-                            },
-                            "order": {
-                                "type": "number"
-                            },
+                            "label": { "type": "string", "minLength": 1 },
+                            "order": { "type": "integer", "minimum": 0 },

80-108: Field basics: constrain type/label/order/hidden.

If you have a known set of UI control types, enumerate them. Also, keep order integer and label non-empty.

-                                        "type": {
-                                            "type": "string"
-                                        },
+                                        "type": { "type": "string" },
                                         "label": {
-                                            "type": "string"
+                                            "type": "string",
+                                            "minLength": 1
                                         },
                                         "order": {
-                                            "type": "number"
+                                            "type": "integer",
+                                            "minimum": 0
                                         },
                                         "format": {
                                             "type": "string"
                                         },
                                         "hidden": {
-                                            "type": "boolean"
+                                            "type": "boolean",
+                                            "default": false
                                         },

If you confirm allowed values for field type/format, I can add oneOf/enum + conditionals (e.g., if type=select then enums is required).


118-138: Default booleans to false (readOnly, required, deleteFlag, systemDate, etc.).

Explicit defaults help downstream UIs and reduce nullish handling.

-                                        "readOnly": {
-                                            "type": "boolean"
-                                        },
+                                        "readOnly": { "type": "boolean", "default": false },
                                         "required": {
-                                            "type": "boolean"
+                                            "type": "boolean",
+                                            "default": false
                                         },
                                         "fieldName": {
-                                            "type": "string"
+                                            "type": "string",
+                                            "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
                                         },
                                         "deleteFlag": {
-                                            "type": "boolean"
+                                            "type": "boolean",
+                                            "default": false
                                         },
                                         "systemDate": {
-                                            "type": "boolean"
+                                            "type": "boolean",
+                                            "default": false
                                         },

154-165: UI flags: provide defaults for includeInForm/includeInSummary/isMultiSelect.

Reduces consumer-side fallback code.

-                                        "includeInForm": {
-                                            "type": "boolean"
-                                        },
-                                        "isMultiSelect": {
-                                            "type": "boolean"
-                                        },
-                                        "includeInSummary": {
-                                            "type": "boolean"
-                                        },
+                                        "includeInForm": { "type": "boolean", "default": true },
+                                        "isMultiSelect": { "type": "boolean", "default": false },
+                                        "includeInSummary": { "type": "boolean", "default": false },

201-209: Top-level flags: provide defaults and consider version typing.

Defaults help when fields are omitted. Also consider semver string if you plan non-integer versions.

-                "summary": {
-                    "type": "boolean"
-                },
-                "version": {
-                    "type": "number"
-                },
-                "disabled": {
-                    "type": "boolean"
-                }
+                "summary": { "type": "boolean", "default": false },
+                "version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+(\\.[0-9]+)?$" },
+                "disabled": { "type": "boolean", "default": false }

If version must be numeric, use "type": "integer", "minimum": 1 instead.


69-186: Optional: add conditional requirements to align field type with config.

E.g., if type in ["select","radio"] then require enums; if isMultiSelect true then type must be "select". Improves data integrity.

I can add an allOf with if/then/else blocks once you confirm the allowed field types and semantics.


1-210: Security note on expressions.

autoFillCondition.expression and visibilityCondition.expression will likely be evaluated at runtime. Ensure the consumer evaluates expressions in a sandboxed, non-eval manner (e.g., JEXL or CEL) to avoid code injection.

If you share the evaluator/library used downstream, I can review the guardrails.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between daaa125 and 7470243.

📒 Files selected for processing (1)
  • mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FormConfigTemplate (1 hunks)
🔇 Additional comments (2)
mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FormConfigTemplate (2)

11-14: Confirm support for x-unique in your MDMS pipeline.

x-unique is not part of JSON Schema draft-07. If your loader enforces it, great—otherwise it will be ignored.

Would you like a migration script to scan existing configs for duplicate (name, project) pairs?


16-25: LGTM on enumerating known flows.

Explicit enum for name guards against typos and keeps configs canonical.

Comment on lines +11 to +15
"x-unique": [
"name",
"project"
],
"properties": {
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.

Comment on lines +27 to +28
"type": "number"
},
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.

Comment on lines +29 to +38
"pages": {
"type": "array",
"items": {
"type": "object",
"required": [
"page",
"label",
"order",
"properties"
],
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.

Comment on lines +52 to +67
"navigateTo": {
"type": "object",
"required": [],
"properties": {
"name": {
"type": "string"
},
"type": {
"enum": [
"template",
"form"
],
"type": "string"
}
}
},
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.

Comment on lines +69 to +79
"type": "array",
"items": {
"type": "object",
"required": [
"type",
"label",
"order",
"format",
"hidden"
],
"properties": {
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.

Comment on lines +84 to +96
"type": "array",
"items": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
},
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.

Comment on lines +139 to +153
"validations": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"value": {},
"message": {
"type": "string"
}
}
}
},
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.

Comment on lines +166 to +177
"autoFillCondition": {
"type": "array",
"items": {
"type": "object",
"properties": {
"value": {},
"expression": {
"type": "string"
}
}
}
},
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.

Comment on lines +178 to +185
"visibilityCondition": {
"type": "object",
"properties": {
"expression": {
"type": "string"
}
}
}
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants