stages/users: fix user names 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). Co-Developed-by: Achilleas Koutsou <achilleas@koutsou.net>
This commit is contained in:
parent
97ff9eb780
commit
690a8fc42a
1 changed files with 38 additions and 38 deletions
|
|
@ -22,12 +22,11 @@ SCHEMA = """
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"properties": {
|
"properties": {
|
||||||
"users": {
|
"users": {
|
||||||
|
"additionalProperties": false,
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"description": "Keys are usernames, values are objects giving user info.",
|
"description": "Keys are usernames, values are objects giving user info.",
|
||||||
"propertyNames": {
|
"patternProperties": {
|
||||||
"pattern": "^[A-Za-z0-9_][A-Za-z0-9_-]{0,31}$"
|
"^[A-Za-z0-9_][A-Za-z0-9_-]{0,31}$": {
|
||||||
},
|
|
||||||
"additionalProperties": {
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"uid": {
|
"uid": {
|
||||||
|
|
@ -68,6 +67,7 @@ SCHEMA = """
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue