fix: prevent stack overflow in InputField.Validate (#25)#106
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||||
Signed-off-by: AR21SM <mahajanashishar21sm@gmail.com>
473e27a to
154f310
Compare
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||
User description
Description
Fixes #25 - Stack overflow on node scenarios.
Added internal
validate(value, validateDefault)helper with a boolean flag to prevent infinite recursion when validating default values for non-String types.Documentation
Related Documentation PR (if applicable)
N/A
PR Type
Bug fix
Description
Prevent stack overflow in InputField validation logic
Add internal validate helper with recursion control flag
Validate default values only once to avoid infinite loops
Diagram Walkthrough
File Walkthrough
field.go
Add recursion control to prevent stack overflowpkg/typing/field.go
Validatemethod to delegate to internalvalidatehelperfunction
validateDefaultboolean parameter to control recursion depthvalidatewithvalidateDefault=falseto prevent infinite recursion