You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The attributes.json file builds in validation with key/value pairs, the value being a regular expression. It is desirable to include more complex information as the values of a requirement's attribute, such as yaml, to enable code generation from the requirement itself.
To enforce valid values, the attribute validators would need to allow constraints in addition to regular expressions, such as an arbitrary go callback function that accepts the value as an input (i.e. isValidYaml()).
I am thinking something like "value": {"regexp": ".*"} for regexps, or "value": {"validatorFn": "validYaml"}.
@aleb also suggested that it might make more sense to use make the attributes file a .go file so that function imports can be done natively and caught at compile-time (I like this idea), or consider yaml.
The text was updated successfully, but these errors were encountered:
The
attributes.json
file builds in validation with key/value pairs, the value being a regular expression. It is desirable to include more complex information as the values of a requirement's attribute, such as yaml, to enable code generation from the requirement itself.To enforce valid values, the attribute validators would need to allow constraints in addition to regular expressions, such as an arbitrary go callback function that accepts the value as an input (i.e.
isValidYaml()
).I am thinking something like "value": {"regexp": ".*"} for regexps, or "value": {"validatorFn": "validYaml"}.
@aleb also suggested that it might make more sense to use make the attributes file a
.go
file so that function imports can be done natively and caught at compile-time (I like this idea), or consider yaml.The text was updated successfully, but these errors were encountered: