incoming
incoming copied to clipboard
validation constraints on datatypes
string:
- regex
- min/max length
array:
- min/max length
I think we can easily implement this, but I would suggest that we: Rename datatypes -> fields: data types is too specific to value types, if we rename it to fields we can use current fields as IntegerField, StringField, etc. and also introduce new fields like RegexField, EnumField, RangeField, etc.
Yeah its just a matter of time. I didn't do it initially because I got busy with something else so just wanted to release something.
The thought about using datatypes/types as a name originated from the fact that initially I just wanted to map it to the valid types in JSON. However, later I did realize that this won't scale and will make the API sound not correct. I had a similar plan of being able to allow such fields. So yeah, I'd say that 's the way forward.