Update domain-schema.json

This commit is contained in:
Joab authored and GitHub committed 2023-12-30 01:29:13 +08:00
1 parent df0018b750
commit ae15fa45ed
1 file changed
+29 -4
+29 -4
View File
@@ -8,8 +8,7 @@
"type": "string"
},
"url": {
"type": "string",
"pattern": "^(https?://)?(?:[a-zA-Z0-9-]+\\.){1,}(?:[a-zA-Z0-9-]{2,})\\/?$"
"type": "string"
},
"email": {
"type": "string",
@@ -20,7 +19,33 @@
"enum": ["A", "CNAME", "TXT", "MX"]
}
},
"required": ["subdomain", "url", "email"],
"additionalProperties": false
"required": ["subdomain", "email"],
"additionalProperties": false,
"if": {
"anyOf": [
{
"properties": {
"type": {
"const": "CNAME"
}
}
},
{
"not": {
"required": ["type"]
}
}
]
},
"then": {
"properties": {
"url": {
"type": "string",
"pattern": "^(https?://)?(?:[a-zA-Z0-9-]+\\.){1,}(?:[a-zA-Z0-9-]{2,})\\/?$"
}
},
"required": ["url"]
},
"else": {}
}
}