-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Describe the solution you'd like
Current type specifications do not allow for complex definition of list and map types. Furthermore, validators are mostly centered on string type validations.
Seems that there's opportunity to implement a richer typing and validation framework.
It might be possible to implement this by extending the current framework. Perhaps something like the following:
.i.e.:
variable:
- name: list-of-ints
type: list[int]
validations:
- required
- length-1-100 # length of list
- each:
- max-1000 # max int value
- name: map-of-ints
type: map[string, int]
validations:
- key:
- alpha
- each:
- max-1000 # max int value
- name: map-of-lists-of-strings
type: map[string, list[string]]
validations:
- required
- key:
- alpha
- each:
- each:
- emailBut it might be worth taking a step back and considering other implementations.
This could also be an opportunity to look for a better maintained validation library, as https://github.com/go-ozzo/ozzo-validation/ hasn't been updated in 5 years.
Let me know if there is value here!
Nepo26
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request