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:
@@ -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(
|
||||
|
@@ -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):
|
||||
|
Reference in New Issue
Block a user