stages/groups: fix group name schema validation

Use `patternProperties` instead of `propertyNames` and `pattern`,
which is not in draft 4 and so did not work (but also did not
throw an error).
This commit is contained in:
Christian Kellner 2021-06-09 13:53:22 +02:00 committed by Lars Karlitski
parent 690a8fc42a
commit d62c8294e1

View file

@ -22,16 +22,16 @@ SCHEMA = """
"properties": {
"groups": {
"type": "object",
"additionalProperties": false,
"description": "Keys are group names, values are objects with group info",
"propertyNames": {
"pattern": "^[A-Za-z0-9_][A-Za-z0-9_-]{0,31}$"
},
"additionalProperties": {
"type": "object",
"properties": {
"gid": {
"type": "number",
"description": "GID for this group"
"patternProperties": {
"^[A-Za-z0-9_][A-Za-z0-9_-]{0,31}$": {
"type": "object",
"properties": {
"gid": {
"type": "number",
"description": "GID for this group"
}
}
}
}