Open
Description
Constraints on object keys should be validated:
/**
* @minLength 2
* @maxLength 256
* @pattern ^\w+$
*/
type ObjectKey = string;
export type MyObject = {
readonly [key: ObjectKey]: string;
}
This should generate a propertyNames
annotation:
{
"type": "object",
"propertyNames": {
"pattern": "^\w+$"
"minLength": 2,
"maxLength": 256
}
}