JSON Schema pattern 关键字

pattern 关键字对字符串值应用正则表达式。

语法

{"type": "string", "pattern": "^[a-z0-9-]+$"}

说明

适用于 slug、标识符和受限文本格式。