1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00

example & example validation cleanup

This commit is contained in:
checktheroads
2020-03-21 15:00:37 -07:00
parent 4b5e37986d
commit cf6958e469
6 changed files with 89 additions and 52 deletions

View File

@@ -35,7 +35,7 @@ class OpenGraph(HyperglassModel):
supported_extensions = (".jpg", ".jpeg", ".png")
if (
values["image"] is not None
and values["image"].suffix not in supported_extensions
and Path(values["image"]).suffix not in supported_extensions
):
raise ValueError(
"OpenGraph image must be one of {e}".format(

View File

@@ -204,6 +204,7 @@ class DnsOverHttps(HyperglassLevel3):
"""Validation model for DNS over HTTPS resolution."""
name: constr(regex="|".join(DNS_OVER_HTTPS.keys())) = "cloudflare"
url: StrictStr = ""
@root_validator
def validate_dns(cls, values):