GeezerVison is showing github.com — Add validation to modules fields · Issue #56 · commitdev/zero-aws-eks-stack
Add validation to modules fields #56
Description
Related to: commitdev/zero#226
Which one of these formats should we pick for passing validation from the modules? leaning towards option 1.
// option1
- field: productionHostRoot
label: Production Root Host Name (e.g. mydomain.com) - this must be the root of the chosen domain, not a subdomain.
fieldValidation:
- type: regex
- value: '^\d{3}-\d{2}-\d{4}$'
- field: productionHostRoot
label: Production Root Host Name (e.g. mydomain.com) - this must be the root of the chosen domain, not a subdomain.
fieldValidation:
- type: function
- value: function_name_goes_here
VS
// option 2
- field: productionHostRoot
label: Production Root Host Name (e.g. mydomain.com) - this must be the root of the chosen domain, not a subdomain.
pattern: regex_goes_here
- field: productionHostRoot
label: Production Root Host Name (e.g. mydomain.com) - this must be the root of the chosen domain, not a subdomain.
validationFunction: function_name_goes_here
cc @davidcheung cc @bmonkman
Activity
bmonkman commented on Aug 4, 2020
Option 1. Depending on the validation function we may need to pass other parameters to it. Might as well stick to the simple ones for now but if we want to support the more complex ones we'll need to have more flexibility.
Metadata
Metadata
Development
No branches or pull requestsIssue actions