如何在JSON模式中强制执行主要次要补丁版本控制?
例如,这将验证:
$cfg['Servers'][$i]['host'] = 'RDS-ENDPOINT-URL';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['user'] = 'USER';
$cfg['Servers'][$i]['password'] = 'PASSWORD';
这不会验证:
{ "version": "1.0.1" }
答案 0 :(得分:3)
想出来,例如:
"version": {
"type": "string",
"pattern": "^([0-9]+).([0-9]+).([0-9]+)$",
"description": "Version (Major, Minor, Patch) identifier"
},